From 9f046e95c0a5c4b842d7405111ebab90e1ba63b6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Oct 2015 13:58:40 +1100 Subject: BLI_Buffer: support over 2gb allocations Also move comment to C-source and enumerate useful features. --- source/blender/blenlib/BLI_buffer.h | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'source/blender/blenlib/BLI_buffer.h') diff --git a/source/blender/blenlib/BLI_buffer.h b/source/blender/blenlib/BLI_buffer.h index 4e5b61da532..941c1c93ae9 100644 --- a/source/blender/blenlib/BLI_buffer.h +++ b/source/blender/blenlib/BLI_buffer.h @@ -23,27 +23,12 @@ /** \file BLI_buffer.h * \ingroup bli - * - * \note this more or less fills same purpose as BLI_array, but makes - * it much easier to resize the array outside of the function it was - * declared in since. - * - * Usage examples: - * \code{.c} - * BLI_buffer_declare_static(int, my_int_array, BLI_BUFFER_NOP, 32); - * - * BLI_buffer_append(my_int_array, int, 42); - * assert(my_int_array.count == 1); - * assert(BLI_buffer_at(my_int_array, int, 0) == 42); - * - * BLI_buffer_free(&my_int_array); - * \endcode */ typedef struct { void *data; - const int elem_size; - int count, alloc_count; + const size_t elem_size; + size_t count, alloc_count; int flag; } BLI_Buffer; @@ -98,7 +83,7 @@ enum { } (void)0 /* Never decreases the amount of memory allocated */ -void BLI_buffer_resize(BLI_Buffer *buffer, int new_count); +void BLI_buffer_resize(BLI_Buffer *buffer, const size_t new_count); /* Does not free the buffer structure itself */ void _bli_buffer_free(BLI_Buffer *buffer); -- cgit v1.2.3