30 if ((*bs_p) ==
nullptr) {
32 uint chunk_count = chunk_size;
34 uint size = chunk_count * stride;
37 chunk_count = size / stride;
47 BLI_assert(stride > 0 && stride <= bs_stride->stride_table_len);
65 size_t *r_size_expanded,
66 size_t *r_size_compacted)
68 size_t size_compacted = 0;
69 size_t size_expanded = 0;
78 *r_size_expanded = size_expanded;
79 *r_size_compacted = size_compacted;
Efficient in-memory storage of multiple similar arrays.
Read Blender memory allocation and freeing.
#define MEM_realloc_zeroed(vmemh, len)
#define MEM_SIZE_OPTIMAL(size)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
struct BArrayStore * BLI_array_store_at_size_get(struct BArrayStore_AtSize *bs_stride, int stride)
struct BArrayStore * BLI_array_store_at_size_ensure(struct BArrayStore_AtSize *bs_stride, int stride, int chunk_size)
MINLINE unsigned int power_of_2_max_u(unsigned int x)
void BLI_array_store_at_size_calc_memory_usage(const struct BArrayStore_AtSize *bs_stride, size_t *r_size_expanded, size_t *r_size_compacted)
BArrayStore * BLI_array_store_create(unsigned int stride, unsigned int chunk_count)
size_t BLI_array_store_calc_size_expanded_get(const BArrayStore *bs)
void BLI_array_store_at_size_clear(struct BArrayStore_AtSize *bs_stride)
size_t BLI_array_store_calc_size_compacted_get(const BArrayStore *bs)
void BLI_array_store_destroy(BArrayStore *bs)
struct BArrayStore ** stride_table