Blender V5.3
blender::blender::implicit_sharing Namespace Reference

Namespaces

namespace  detail

Functions

template<typename T>
void copy_shared_pointer (T *src_ptr, const ImplicitSharingInfo *src_sharing_info, T **r_dst_ptr, const ImplicitSharingInfo **r_dst_sharing_info)
template<typename T>
void free_shared_data (T **data, const ImplicitSharingInfo **sharing_info)
template<typename T>
const ImplicitSharingInfo * info_for_mem_free (T *data)
template<typename T>
void make_trivial_data_mutable (T **data, const ImplicitSharingInfo **sharing_info, const int64_t size)
template<typename T>
void resize_trivial_array (T **data, const ImplicitSharingInfo **sharing_info, int64_t old_size, int64_t new_size)

Function Documentation

◆ copy_shared_pointer()

template<typename T>
void blender::blender::implicit_sharing::copy_shared_pointer ( T * src_ptr,
const ImplicitSharingInfo * src_sharing_info,
T ** r_dst_ptr,
const ImplicitSharingInfo ** r_dst_sharing_info )

Copy shared data from the source to the destination, adding a user count.

Note
Does not free any existing data in the destination.

Definition at line 271 of file bmesh_polygon.hh.

◆ free_shared_data()

template<typename T>
void blender::blender::implicit_sharing::free_shared_data ( T ** data,
const ImplicitSharingInfo ** sharing_info )

Remove this reference to the shared data and remove dangling pointers.

Definition at line 287 of file bmesh_polygon.hh.

◆ info_for_mem_free()

template<typename T>
const ImplicitSharingInfo * blender::blender::implicit_sharing::info_for_mem_free ( T * data)

Create an implicit sharing object that takes ownership of the data, allowing it to be shared. When it is no longer used, the data is freed with #MEM_delete, so it must be a trivial type.

Definition at line 301 of file bmesh_polygon.hh.

◆ make_trivial_data_mutable()

template<typename T>
void blender::blender::implicit_sharing::make_trivial_data_mutable ( T ** data,
const ImplicitSharingInfo ** sharing_info,
const int64_t size )

Make data mutable (single-user) if it is shared. For trivially-copyable data only.

Definition at line 313 of file bmesh_polygon.hh.

◆ resize_trivial_array()

template<typename T>
void blender::blender::implicit_sharing::resize_trivial_array ( T ** data,
const ImplicitSharingInfo ** sharing_info,
int64_t old_size,
int64_t new_size )

Resize an array of shared data. For trivially-copyable data only. Any new values are not initialized.

Definition at line 326 of file bmesh_polygon.hh.