Age | Commit message (Collapse) | Author |
|
This wasn't working reliably (after clear for example), and wasn't used anywhere.
|
|
|
|
alloc_size was set incorrectly causing arrays not to be resized correctly.
|
|
Part of patch D1670 by @LazyDodo
|
|
|
|
Useful for re-using a buffer when the existing data can be thrown away.
|
|
Also move comment to C-source and enumerate useful features.
|
|
When resizing, zero memory when the calloc flag is set,
even when no realloc is done.
|
|
|
|
|
|
|
|
- assert if BLI_buffer_at() is called with an out of bounds value.
- add BLI_buffer_resize_data() macro which resizes and returns a pointer to the new array.
- warn if missing call to BLI_buffer_free().
|
|
- add option to calloc or not, existing code wasnt consistent here, would calloc on first alloc but not on realloc, also - the static memory was never zero'd.
use flag BLI_BUFFER_USE_CALLOC to ensure all new memory is zero'd (static/alloc/realloc's).
- add BLI_buffer_declare_static / BLI_buffer_declare so its possible to have a buffer that never uses static memory.
|
|
BLI_buffer is a dynamic homogeneous array similar to BLI_array, but it
allocates a structure that can be passed around making it possible to
resize the array outside the function it was declared in.
|