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().
This commit is contained in:
2013-03-16 00:12:14 +00:00
parent 93836a24aa
commit 1b994dbeb0
2 changed files with 21 additions and 4 deletions

View File

@@ -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) {