Blender V5.0
BLI_memory_utils.hh File Reference
#include <algorithm>
#include <memory>
#include <type_traits>
#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"

Go to the source code of this file.

Classes

struct  blender::DestructValueAtAddress< T >
class  blender::AlignedBuffer< Size, Alignment >
class  blender::TypedBuffer< T, Size >
class  blender::DynamicStackBuffer< ReservedSize, ReservedAlignment >
class  blender::NoInitialization
class  blender::NoExceptConstructor
struct  blender::detail::ScopedDeferHelper< Func >

Namespaces

namespace  blender
namespace  blender::detail

Macros

#define BLI_SCOPED_DEFER_NAME1(a, b)
#define BLI_SCOPED_DEFER_NAME2(a, b)
#define BLI_SCOPED_DEFER_NAME(a)
#define BLI_SCOPED_DEFER(function_to_defer)

Typedefs

template<typename T>
using blender::destruct_ptr = std::unique_ptr<T, DestructValueAtAddress<T>>

Functions

template<typename T>
void blender::destruct_n (T *ptr, int64_t n)
template<typename T>
void blender::default_construct_n (T *ptr, int64_t n)
template<typename T>
void blender::initialized_copy_n (const T *src, int64_t n, T *dst)
template<typename T>
void blender::uninitialized_copy_n (const T *src, int64_t n, T *dst)
template<typename From, typename To>
void blender::uninitialized_convert_n (const From *src, int64_t n, To *dst)
template<typename T>
void blender::initialized_move_n (T *src, int64_t n, T *dst)
template<typename T>
void blender::uninitialized_move_n (T *src, int64_t n, T *dst)
template<typename T>
void blender::initialized_relocate_n (T *src, int64_t n, T *dst)
template<typename T>
void blender::uninitialized_relocate_n (T *src, int64_t n, T *dst)
template<typename T>
void blender::initialized_fill_n (T *dst, int64_t n, const T &value)
template<typename T>
void blender::uninitialized_fill_n (T *dst, int64_t n, const T &value)
constexpr int64_t blender::default_inline_buffer_capacity (size_t element_size)
template<typename Container>
Container & blender::copy_assign_container (Container &dst, const Container &src)
template<typename Container>
Container & blender::move_assign_container (Container &dst, Container &&src) noexcept(std::is_nothrow_move_constructible_v< Container >)
template<typename T>
bool blender::assign_if_different (T &old_value, T new_value)

Variables

template<typename T>
constexpr bool blender::is_trivial_extended_v = std::is_trivial_v<T>
template<typename T>
constexpr bool blender::is_trivially_destructible_extended_v
template<typename T>
constexpr bool blender::is_trivially_copy_constructible_extended_v
template<typename T>
constexpr bool blender::is_trivially_move_constructible_extended_v
template<typename From, typename To>
constexpr bool blender::is_convertible_pointer_v
template<typename From, typename To>
constexpr bool blender::is_span_convertible_pointer_v
template<typename T, typename... Args>
constexpr bool blender::is_same_any_v = (std::is_same_v<T, Args> || ...)

Macro Definition Documentation

◆ BLI_SCOPED_DEFER

#define BLI_SCOPED_DEFER ( function_to_defer)
Value:

Execute the given function when the current scope ends. This can be used to cheaply implement some RAII-like behavior for C types that don't support it. Long term, the types we want to use this with should either be converted to C++ or get a proper C++ API. Until then, this function can help avoid common resource leakages.

Definition at line 407 of file BLI_memory_utils.hh.

Referenced by blender::ed::viewer_path::activate_geometry_node(), BKE_crazyspace_build_sculpt(), BKE_curve_minmax(), BKE_sculpt_get_first_deform_matrices(), blender::bke::AttributeStorage::blend_read(), BM_mesh_bm_from_me(), blender::bke::mesh::build_vert_to_edge_map(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::bke::id_hash::compute_deep_hash_recursive(), blender::bke::id_hash::compute_file_hash_with_memory_map(), blender::compositor::convolve(), blender::bke::bake::directory_is_empty(), blender::nodes::node_geo_viewer_cc::draw_generic_value_log(), blender::ed::space_node::draw_nodetree(), ED_screens_init(), blender::NodesModifierUsageInferenceCache::ensure(), blender::compositor::Evaluator::evaluate(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::fn::lazy_function::Executor::execute(), blender::nodes::materialx::export_to_materialx(), fileselect_ensure_updated_file_params(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::viewer_path::find_geometry_nodes_viewer(), blender::bke::bake::find_sorted_meta_files(), blender::nodes::node_geo_interpolate_curves_cc::generate_interpolated_curves(), blender::bke::AttributeFieldInput::get_varray_for_context(), blender::bke::EvaluateOnDomainInput::get_varray_for_context(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::io::csv::import_csv_as_pointcloud(), blender::bke::bake::load_attributes(), M_Geometry_delaunay_2d_cdt(), menu_items_from_ui_create(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec(), blender::nodes::node_geo_image_info_cc::node_geo_exec(), blender::nodes::node_geo_import_csv::node_geo_exec(), blender::nodes::node_geo_import_obj::node_geo_exec(), blender::nodes::node_geo_import_stl::node_geo_exec(), blender::nodes::node_geo_import_text::node_geo_exec(), blender::nodes::nodes_geo_import_ply::node_geo_exec(), blender::ed::space_node::node_group_make_test_selected(), blender::bke::bake::pack_files_from_directory(), blender::ed::greasepencil::process_image(), blender::ed::asset::index::AssetIndexFile::read_contents(), blender::io::stl::read_stl_ascii(), blender::io::stl::read_stl_file(), blender::ed::greasepencil::render_strokes(), blender::bke::mesh::reverse_group_indices_in_groups(), blender::bke::mesh::reverse_indices_in_groups(), blender::nodes::node_geo_scale_elements_cc::reverse_indices_in_groups(), blender::ed::geometry::run_node_group_exec(), blender::ed::greasepencil::selection_update(), blender::ed::curves::set_attribute_exec(), blender::ed::pointcloud::set_attribute_exec(), blender::ed::curves::set_attribute_invoke(), blender::ed::pointcloud::set_attribute_invoke(), blender::tests::TEST(), blender::tests::TEST(), ui_but_event_operator_string_from_panel(), ui_but_event_property_operator_string(), blender::ed::viewer_path::update_active_geometry_nodes_viewer(), blender::nodes::node_geo_distribute_points_on_faces_cc::update_elimination_mask_for_close_points(), blender::ed::curves::validate_value(), and blender::ed::pointcloud::validate_value().

◆ BLI_SCOPED_DEFER_NAME

#define BLI_SCOPED_DEFER_NAME ( a)
Value:
BLI_SCOPED_DEFER_NAME2(_scoped_defer_##a##_, __LINE__)
#define BLI_SCOPED_DEFER_NAME2(a, b)

Definition at line 399 of file BLI_memory_utils.hh.

◆ BLI_SCOPED_DEFER_NAME1

#define BLI_SCOPED_DEFER_NAME1 ( a,
b )
Value:

Definition at line 397 of file BLI_memory_utils.hh.

◆ BLI_SCOPED_DEFER_NAME2

#define BLI_SCOPED_DEFER_NAME2 ( a,
b )
Value:
#define BLI_SCOPED_DEFER_NAME1(a, b)

Definition at line 398 of file BLI_memory_utils.hh.