Blender V4.5
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 255 of file BLI_implicit_sharing.hh.

References BLI_assert, and T.

Referenced by blender::geometry::copy_and_reorder_mesh_edges(), blender::geometry::copy_and_reorder_mesh_verts(), blender::geometry::create_curves_for_faces(), mesh_copy_data(), blender::ed::sculpt_paint::undo::restore_geometry_data(), and blender::ed::sculpt_paint::undo::store_geometry_data().

◆ free_shared_data()

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

◆ info_for_mem_free()

◆ 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 291 of file BLI_implicit_sharing.hh.

References data, blender::implicit_sharing::detail::make_trivial_data_mutable_impl(), size(), and T.

Referenced by blender::bke::CurvesGeometry::nurbs_custom_knots_for_write(), and 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 )