diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-16 04:12:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-16 04:12:14 +0400 |
commit | 1b994dbeb0e6ea7220e636d2b828eb427065772b (patch) | |
tree | 45213d655f9e9c8cd89a24d8d963f83a9d0fd1c9 /source/blender/blenlib/intern/buffer.c | |
parent | 93836a24aaba3965232c6df3f525302bd9b924ce (diff) |
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().
Diffstat (limited to 'source/blender/blenlib/intern/buffer.c')
-rw-r--r-- | source/blender/blenlib/intern/buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/buffer.c b/source/blender/blenlib/intern/buffer.c index b2280b9a0d1..aac3a3bc3f3 100644 --- a/source/blender/blenlib/intern/buffer.c +++ b/source/blender/blenlib/intern/buffer.c @@ -70,7 +70,8 @@ void BLI_buffer_resize(BLI_Buffer *buffer, int new_count) buffer->count = new_count; } -void BLI_buffer_free(BLI_Buffer *buffer) +/* callers use BLI_buffer_free */ +void _bli_buffer_free(BLI_Buffer *buffer) { if ((buffer->flag & BLI_BUFFER_USE_STATIC) == 0) { if (buffer->data) { |