diff options
Diffstat (limited to 'source/blender/blenlib/BLI_stack.h')
-rw-r--r-- | source/blender/blenlib/BLI_stack.h | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/source/blender/blenlib/BLI_stack.h b/source/blender/blenlib/BLI_stack.h index ac96195d390..d65c8f02462 100644 --- a/source/blender/blenlib/BLI_stack.h +++ b/source/blender/blenlib/BLI_stack.h @@ -28,27 +28,22 @@ * \ingroup bli */ +#include "BLI_compiler_attrs.h" + typedef struct BLI_Stack BLI_Stack; -/* Create a new homogeneous stack with elements of 'elem_size' bytes */ -BLI_Stack *BLI_stack_new(size_t elem_size, const char *description); +BLI_Stack *BLI_stack_new_ex( + const size_t elem_size, const char *description, + const size_t chunk_size) ATTR_NONNULL(); +BLI_Stack *BLI_stack_new( + const size_t elem_size, const char *description) ATTR_NONNULL(); -/* Free the stack's data and the stack itself */ -void BLI_stack_free(BLI_Stack *stack); +void BLI_stack_free(BLI_Stack *stack) ATTR_NONNULL(); -/* Copies the source value onto the stack (note that it copies - * elem_size bytes from 'src', the pointer itself is not stored) */ -void BLI_stack_push(BLI_Stack *stack, void *src); +void BLI_stack_push(BLI_Stack *stack, const void *src) ATTR_NONNULL(); -/* Retrieves and removes the top element from the stack. The value is - * copies to 'dst', which must be at least elem_size bytes. - * - * Does not reduce amount of allocated memory. - * - * If stack is empty, 'dst' will not be modified. */ -void BLI_stack_pop(BLI_Stack *stack, void *dst); +void BLI_stack_pop(BLI_Stack *stack, void *dst) ATTR_NONNULL(); -/* Returns true if the stack is empty, false otherwise */ -bool BLI_stack_is_empty(const BLI_Stack *stack); +bool BLI_stack_is_empty(const BLI_Stack *stack) ATTR_NONNULL(); #endif |