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

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::NoInitialization
class  blender::NoExceptConstructor
struct  blender::blenlib_detail::ScopedDeferHelper< Func >

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::blenlib_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)
template<typename T>
bool blender::assign_if_different (T &old_value, const 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:
auto BLI_SCOPED_DEFER_NAME(func) = (function_to_defer); \
blenlib_detail::ScopedDeferHelper<decltype(BLI_SCOPED_DEFER_NAME(func))> BLI_SCOPED_DEFER_NAME( \
helper){std::move(BLI_SCOPED_DEFER_NAME(func))};
#define BLI_SCOPED_DEFER_NAME(a)

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 367 of file BLI_memory_utils.hh.

Referenced by blender::ed::viewer_path::activate_geometry_node(), blender::bke::asset_edit_id_ensure_local(), blender::BKE_crazyspace_build_sculpt(), blender::BKE_curve_minmax(), blender::BKE_sculpt_get_first_deform_matrices(), blender::bke::AttributeStorage::blend_read(), blender::blo_read_file_internal(), blender::BM_mesh_bm_from_me(), blender::ui::but_event_operator_string_from_panel(), blender::ui::but_event_property_operator_string(), blender::ed::sculpt_paint::auto_mask::calc_interpolated_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::io::ply::convert_gsplat_ply_to_point_cloud(), blender::io::ply::convert_ply_to_mesh(), 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(), blender::ED_screens_init(), blender::NodesModifierUsageInferenceCache::ensure(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::fn::lazy_function::generic_graph_executor::GenericGraphExecutor::execute(), blender::nodes::node_composite_base_cryptomatte_cc::BaseCryptoMatteOperation::execute(), blender::nodes::node_composite_convert_color_space_cc::ConvertColorSpaceOperation::execute(), blender::nodes::node_geo_get_bundle_item_cc::GetBundleItemOperation::execute(), blender::nodes::node_geo_separate_bundle_cc::SeparateBundleOperation::execute(), blender::nodes::materialx::export_to_materialx(), blender::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::foreach_nested_bundle_item_recursive(), blender::compositor::get_bundle_info_log(), blender::nodes::node_geo_import_text::get_cached_text(), blender::image_engine::Instance::get_drawing_mode(), blender::render::Context::get_pass(), 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::io::ply::import_geometry_set(), blender::io::ply::importer_main_impl(), blender::bke::bake::load_attributes(), blender::logImageGetDataRGBA(), blender::M_Geometry_delaunay_2d_cdt(), blender::ui::menu_items_from_ui_create(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), blender::nodes::node_composite_image_cc::node_declare(), blender::nodes::node_composite_render_layer_cc::node_declare(), blender::nodes::node_composite_image_cc::node_declare_multi_layer(), 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_spz::node_geo_exec(), blender::nodes::node_geo_import_stl::node_geo_exec(), blender::nodes::nodes_geo_import_ply::node_geo_exec(), blender::ed::space_node::node_group_make_test_selected(), blender::ed::geometry::operator_idname_get(), blender::ui::MarkdownLayouter::output_wrapped_text(), blender::bke::bake::pack_files_from_directory(), blender::ed::greasepencil::process_image(), blender::bke::read_attr_data(), blender::ed::asset::index::AssetIndexFile::read_contents(), blender::ed::asset::index::read_contents(), blender::read_libraries(), blender::io::stl::read_stl_ascii(), blender::io::stl::read_stl_file(), blender::ed::greasepencil::render_strokes(), blender::ed::sculpt_paint::sample_texture_paint_color(), 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::store_layer(), blender::compositor::StringImage::StringImage(), blender::tests::TEST(), blender::tests::TEST(), blender::deg::tests::TEST_F(), blender::timeline_draw_cache(), blender::ui::try_activate_rna_button(), blender::um_arraystore_cd_create(), blender::um_arraystore_cd_expand(), blender::ed::viewer_path::update_active_geometry_nodes_viewer(), blender::ed::curves::validate_value(), blender::ed::pointcloud::validate_value(), blender::wm_draw_window_onscreen(), and blender::wm_read_exotic().

◆ 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 359 of file BLI_memory_utils.hh.

◆ BLI_SCOPED_DEFER_NAME1

#define BLI_SCOPED_DEFER_NAME1 ( a,
b )
Value:

Definition at line 357 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 358 of file BLI_memory_utils.hh.