Commit Graph

13 Commits

Author SHA1 Message Date
b9dea0f941 Remove BLI_buffer calloc option
This wasn't working reliably (after clear for example), and wasn't used anywhere.
2015-12-24 01:52:54 +11:00
5884a0d66e Correct last commit, picky type warnings 2015-10-04 15:11:38 +11:00
74a2fa3095 BLI_Buffer: add BLI_buffer_reinit
Useful for re-using a buffer when the existing data can be thrown away.
2015-10-04 14:29:27 +11:00
9f046e95c0 BLI_Buffer: support over 2gb allocations
Also move comment to C-source and enumerate useful features.
2015-10-04 14:10:26 +11:00
2af905391d cleanup: doxy comments 2015-02-14 08:00:41 +11:00
642c8243e7 BLI_buffer: empty macro 2014-10-10 10:10:13 +02:00
8beb565c59 code cleanup: headers - doxy comments. 2013-09-12 03:02:50 +00:00
00b39c4e5b code cleanup: more confusion with 0/NULL/false 2013-08-07 03:55:21 +00:00
e3f6875df0 fix for error in BLI_buffer_declare_static(), the stack variable wasn't the right size, from original commit 53440.
Caused UV stretch display to fail.
2013-07-26 15:26:51 +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
0d95dde79b add assert to BLI_buffer_at if a type is given different to 'elem_size' 2013-01-02 05:19:55 +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