Blender V4.3
BLI_mempool.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11#include "BLI_compiler_attrs.h"
12#include "BLI_utildefines.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18struct BLI_mempool;
20
21typedef struct BLI_mempool BLI_mempool;
22
24 unsigned int elem_num,
25 unsigned int pchunk,
26 unsigned int flag)
29 ATTR_NONNULL(1);
37void BLI_mempool_free(BLI_mempool *pool, void *addr) ATTR_NONNULL(1, 2);
44void BLI_mempool_clear_ex(BLI_mempool *pool, int elem_num_reserve) ATTR_NONNULL(1);
53int BLI_mempool_len(const BLI_mempool *pool) ATTR_NONNULL(1);
54void *BLI_mempool_findelem(BLI_mempool *pool, unsigned int index) ATTR_WARN_UNUSED_RESULT
55 ATTR_NONNULL(1);
56
60void BLI_mempool_as_array(BLI_mempool *pool, void *data) ATTR_NONNULL(1, 2);
65 const char *allocstr) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
66 ATTR_NONNULL(1, 2);
67
68#ifndef NDEBUG
70#endif
71
83
85enum {
96};
97
106
107#ifdef __cplusplus
108}
109#endif
#define ATTR_WARN_UNUSED_RESULT
#define ATTR_MALLOC
#define ATTR_RETURNS_NONNULL
#define ATTR_NONNULL(...)
void void void BLI_mempool_set_memory_debug(void)
void * BLI_mempool_alloc(BLI_mempool *pool) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter) ATTR_NONNULL()
void * BLI_mempool_iterstep(BLI_mempool_iter *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void void BLI_mempool_clear_ex(BLI_mempool *pool, int elem_num_reserve) ATTR_NONNULL(1)
void void * BLI_mempool_as_arrayN(BLI_mempool *pool, const char *allocstr) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void BLI_mempool_free(BLI_mempool *pool, void *addr) ATTR_NONNULL(1
BLI_mempool * BLI_mempool_create(unsigned int esize, unsigned int elem_num, unsigned int pchunk, unsigned int flag) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
int BLI_mempool_len(const BLI_mempool *pool) ATTR_NONNULL(1)
void * BLI_mempool_findelem(BLI_mempool *pool, unsigned int index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
@ BLI_MEMPOOL_ALLOW_ITER
Definition BLI_mempool.h:95
@ BLI_MEMPOOL_NOP
Definition BLI_mempool.h:86
void * BLI_mempool_calloc(BLI_mempool *pool) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
struct BLI_mempool_iter BLI_mempool_iter
void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1)
void BLI_mempool_clear(BLI_mempool *pool) ATTR_NONNULL(1)
void BLI_mempool_as_array(BLI_mempool *pool, void *data) ATTR_NONNULL(1
struct BLI_mempool_chunk * curchunk
Definition BLI_mempool.h:80
BLI_mempool * pool
Definition BLI_mempool.h:79
unsigned int curindex
Definition BLI_mempool.h:81
uint8_t flag
Definition wm_window.cc:138