Commit Graph

6 Commits

Author SHA1 Message Date
15af15eb56 BLI_buffer: simplify buffer resize 2014-10-05 10:33:02 +02:00
8beb565c59 code cleanup: headers - doxy comments. 2013-09-12 03:02:50 +00:00
bd89bd9e1c avoid using MEM_reallocN_id directly, add utility macro for freeing. 2013-08-04 03:00:04 +00:00
1b994dbeb0 changes to BLI_buffer
- 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().
2013-03-16 00:12:14 +00:00
9190c493c1 extend BLI_buffer
- 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.
2013-01-02 05:00:02 +00:00
2c9d22fe31 Add BLI_buffer, an alternative to BLI_array
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.
2012-12-30 18:28:10 +00:00