|
Blender
V2.93
|
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers, using a single linked list allocated from a mempool. More...
Go to the source code of this file.
Macros | |
Linked Stack (mempool) | |
Uses BLI_mempool for storage. | |
| #define | BLI_LINKSTACK_DECLARE(var, type) |
| #define | BLI_LINKSTACK_INIT(var) |
| #define | BLI_LINKSTACK_SIZE(var) BLI_mempool_len(var##_pool_) |
| #define | BLI_LINKSTACK_PUSH(var, ptr) (BLI_linklist_prepend_pool(&(var), ptr, var##_pool_)) |
| #define | BLI_LINKSTACK_POP(var) (var ? BLI_linklist_pop_pool(&(var), var##_pool_) : NULL) |
| #define | BLI_LINKSTACK_POP_DEFAULT(var, r) (var ? BLI_linklist_pop_pool(&(var), var##_pool_) : r) |
| #define | BLI_LINKSTACK_SWAP(var_a, var_b) |
| #define | BLI_LINKSTACK_FREE(var) |
Linked Stack (alloca) | |
Linked Stack, using stack memory (alloca). alloca never frees, pop'd items are stored in a free-list for reuse. only use for lists small enough to fit on the stack. | |
| #define | _BLI_SMALLSTACK_CAST(var) |
| #define | _BLI_SMALLSTACK_FAKEUSER(var) (void)(&(_##var##_type)) |
| #define | BLI_SMALLSTACK_DECLARE(var, type) |
| #define | BLI_SMALLSTACK_PUSH(var, data) |
| #define | _BLI_SMALLSTACK_DEL_EX(var_src, var_dst) |
| #define | _BLI_SMALLSTACK_DEL(var) _BLI_SMALLSTACK_DEL_EX(var, var) |
| #define | BLI_SMALLSTACK_POP(var) |
| #define | BLI_SMALLSTACK_POP_EX(var_src, var_dst) |
| #define | BLI_SMALLSTACK_PEEK(var) (_BLI_SMALLSTACK_CAST(var)((_##var##_stack) ? _##var##_stack->link : NULL)) |
| #define | BLI_SMALLSTACK_IS_EMPTY(var) ((_BLI_SMALLSTACK_CAST(var) _##var##_stack) == NULL) |
| #define | BLI_SMALLSTACK_AS_TABLE(var, data) |
| #define | BLI_SMALLSTACK_ITER_BEGIN(var, item) |
| #define | BLI_SMALLSTACK_ITER_END |
| #define | BLI_SMALLSTACK_SWAP(var_a, var_b) |
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers, using a single linked list allocated from a mempool.
_##var##_type is a dummy variable only used for typechecks. Definition in file BLI_linklist_stack.h.
| #define _BLI_SMALLSTACK_CAST | ( | var | ) |
Definition at line 105 of file BLI_linklist_stack.h.
| #define _BLI_SMALLSTACK_DEL | ( | var | ) | _BLI_SMALLSTACK_DEL_EX(var, var) |
Definition at line 140 of file BLI_linklist_stack.h.
| #define _BLI_SMALLSTACK_DEL_EX | ( | var_src, | |
| var_dst | |||
| ) |
Definition at line 132 of file BLI_linklist_stack.h.
| #define _BLI_SMALLSTACK_FAKEUSER | ( | var | ) | (void)(&(_##var##_type)) |
Definition at line 108 of file BLI_linklist_stack.h.
| #define BLI_LINKSTACK_DECLARE | ( | var, | |
| type | |||
| ) |
Definition at line 40 of file BLI_linklist_stack.h.
| #define BLI_LINKSTACK_FREE | ( | var | ) |
Definition at line 77 of file BLI_linklist_stack.h.
| #define BLI_LINKSTACK_INIT | ( | var | ) |
Definition at line 45 of file BLI_linklist_stack.h.
| #define BLI_LINKSTACK_POP | ( | var | ) | (var ? BLI_linklist_pop_pool(&(var), var##_pool_) : NULL) |
Definition at line 65 of file BLI_linklist_stack.h.
| #define BLI_LINKSTACK_POP_DEFAULT | ( | var, | |
| r | |||
| ) | (var ? BLI_linklist_pop_pool(&(var), var##_pool_) : r) |
Definition at line 66 of file BLI_linklist_stack.h.
| #define BLI_LINKSTACK_PUSH | ( | var, | |
| ptr | |||
| ) | (BLI_linklist_prepend_pool(&(var), ptr, var##_pool_)) |
Definition at line 64 of file BLI_linklist_stack.h.
| #define BLI_LINKSTACK_SIZE | ( | var | ) | BLI_mempool_len(var##_pool_) |
Definition at line 52 of file BLI_linklist_stack.h.
| #define BLI_LINKSTACK_SWAP | ( | var_a, | |
| var_b | |||
| ) |
Definition at line 69 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_AS_TABLE | ( | var, | |
| data | |||
| ) |
Definition at line 160 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_DECLARE | ( | var, | |
| type | |||
| ) |
| #define BLI_SMALLSTACK_IS_EMPTY | ( | var | ) | ((_BLI_SMALLSTACK_CAST(var) _##var##_stack) == NULL) |
Definition at line 157 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_ITER_BEGIN | ( | var, | |
| item | |||
| ) |
Definition at line 172 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_ITER_END |
Definition at line 178 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_PEEK | ( | var | ) | (_BLI_SMALLSTACK_CAST(var)((_##var##_stack) ? _##var##_stack->link : NULL)) |
Definition at line 154 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_POP | ( | var | ) |
Definition at line 143 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_POP_EX | ( | var_src, | |
| var_dst | |||
| ) |
Definition at line 148 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_PUSH | ( | var, | |
| data | |||
| ) |
Definition at line 114 of file BLI_linklist_stack.h.
| #define BLI_SMALLSTACK_SWAP | ( | var_a, | |
| var_b | |||
| ) |
Definition at line 183 of file BLI_linklist_stack.h.