Blender V4.3
blender::implicit_sharing Namespace Reference

Namespaces

namespace  detail
 

Classes

class  MEMFreeImplicitSharing
 

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)
 
const ImplicitSharingInfoinfo_for_mem_free (void *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::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 257 of file BLI_implicit_sharing.hh.

References BLI_assert.

Referenced by mesh_copy_data().

◆ free_shared_data()

template<typename T >
void 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 273 of file BLI_implicit_sharing.hh.

References BLI_assert.

Referenced by mesh_clear_geometry(), and blender::bke::CurvesGeometry::~CurvesGeometry().

◆ info_for_mem_free()

const ImplicitSharingInfo * blender::implicit_sharing::info_for_mem_free ( void * data)

◆ make_trivial_data_mutable()

template<typename T >
void 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 293 of file BLI_implicit_sharing.hh.

References blender::implicit_sharing::detail::make_trivial_data_mutable_impl().

Referenced by blender::bke::CurvesGeometry::offsets_for_write().

◆ resize_trivial_array()

template<typename T >
void 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 306 of file BLI_implicit_sharing.hh.

References blender::implicit_sharing::detail::resize_trivial_array_impl().

Referenced by blender::nodes::node_geo_extrude_mesh_cc::expand_mesh(), and blender::bke::CurvesGeometry::resize().