|
Blender V5.3
|
Efficient memory allocation for many small chunks. More...
#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_asan.hh"#include "BLI_memarena.hh"#include "BLI_utildefines.hh"#include "BLI_strict_flags.hh"Go to the source code of this file.
Classes | |
| struct | blender::MemBuf |
| struct | blender::MemArena |
Namespaces | |
| namespace | blender |
| BMesh Iterators. | |
Macros | |
| #define | VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed) |
| #define | VALGRIND_DESTROY_MEMPOOL(pool) |
| #define | VALGRIND_MEMPOOL_ALLOC(pool, addr, size) |
| #define | VALGRIND_MOVE_MEMPOOL(pool_a, pool_b) |
| #define | PADUP(num, amt) |
Functions | |
| static void | blender::memarena_buf_free_all (MemBuf *mb) |
| MemArena * | blender::BLI_memarena_new (size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC |
| void | blender::BLI_memarena_use_calloc (MemArena *ma) ATTR_NONNULL(1) |
| void | blender::BLI_memarena_use_malloc (MemArena *ma) ATTR_NONNULL(1) |
| void | blender::BLI_memarena_use_align (MemArena *ma, size_t align) ATTR_NONNULL(1) |
| void | blender::BLI_memarena_free (MemArena *ma) ATTR_NONNULL(1) |
| static void | blender::memarena_curbuf_align (MemArena *ma) |
| void * | blender::BLI_memarena_alloc (MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2) |
| void * | blender::BLI_memarena_calloc (MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2) |
| void | blender::BLI_memarena_merge (MemArena *ma_dst, MemArena *ma_src) |
| void | blender::BLI_memarena_clear (MemArena *ma) ATTR_NONNULL(1) |
Efficient memory allocation for many small chunks.
Memory arena's are commonly used when the program needs to quickly allocate lots of little bits of data, which are all freed at the same moment.
Definition in file BLI_memarena.cc.
| #define PADUP | ( | num, | |
| amt ) |
Pad num up by amt (must be power of two).
Definition at line 113 of file BLI_memarena.cc.
Referenced by blender::BLI_memarena_alloc(), and blender::memarena_curbuf_align().
| #define VALGRIND_CREATE_MEMPOOL | ( | pool, | |
| rzB, | |||
| is_zeroed ) |
Definition at line 29 of file BLI_memarena.cc.
Referenced by blender::BLI_memarena_clear(), blender::BLI_memarena_merge(), blender::BLI_memarena_new(), blender::BLI_mempool_clear_ex(), and blender::BLI_mempool_create().
| #define VALGRIND_DESTROY_MEMPOOL | ( | pool | ) |
Definition at line 30 of file BLI_memarena.cc.
Referenced by blender::BLI_memarena_clear(), blender::BLI_memarena_free(), blender::BLI_mempool_clear_ex(), and blender::BLI_mempool_destroy().
| #define VALGRIND_MEMPOOL_ALLOC | ( | pool, | |
| addr, | |||
| size ) |
Definition at line 31 of file BLI_memarena.cc.
Referenced by blender::BLI_memarena_alloc(), blender::BLI_mempool_alloc(), and blender::BLI_mempool_free().
| #define VALGRIND_MOVE_MEMPOOL | ( | pool_a, | |
| pool_b ) |
Definition at line 32 of file BLI_memarena.cc.
Referenced by blender::BLI_memarena_merge().