Blender
V3.3
|
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_buffer.h"
#include "BLI_utildefines.h"
#include "BLI_strict_flags.h"
Go to the source code of this file.
Functions | |
static void * | buffer_alloc (BLI_Buffer *buffer, const size_t len) |
static void * | buffer_realloc (BLI_Buffer *buffer, const size_t len) |
void | BLI_buffer_resize (BLI_Buffer *buffer, const size_t new_count) |
void | BLI_buffer_reinit (BLI_Buffer *buffer, const size_t new_count) |
void | _bli_buffer_append_array (BLI_Buffer *buffer, void *new_data, size_t count) |
void | _bli_buffer_free (BLI_Buffer *buffer) |
Primitive generic buffer library.
Usage examples:
Definition in file buffer.c.
void _bli_buffer_append_array | ( | BLI_Buffer * | buffer, |
void * | data, | ||
size_t | count | ||
) |
Append an array of elements.
Callers use BLI_buffer_append_array.
Definition at line 98 of file buffer.c.
References BLI_buffer_resize(), buffer, count, and size().
void _bli_buffer_free | ( | BLI_Buffer * | buffer | ) |
Does not free the buffer structure itself.
Callers use BLI_buffer_free.
Definition at line 107 of file buffer.c.
References BLI_BUFFER_USE_STATIC, buffer, and MEM_freeN.
void BLI_buffer_reinit | ( | BLI_Buffer * | buffer, |
size_t | new_count | ||
) |
Ensure size, throwing away old data, respecting #BLI_BUFFER_USE_CALLOC.
Similar to BLI_buffer_resize, but use when the existing data can be:
Definition at line 75 of file buffer.c.
References BLI_BUFFER_USE_STATIC, buffer, buffer_alloc(), MEM_freeN, and UNLIKELY.
Referenced by pbvh_bmesh_edge_loops().
void BLI_buffer_resize | ( | BLI_Buffer * | buffer, |
size_t | new_count | ||
) |
Definition at line 49 of file buffer.c.
References BLI_BUFFER_USE_STATIC, buffer, buffer_alloc(), buffer_realloc(), and UNLIKELY.
Referenced by _bli_buffer_append_array().
|
static |
Definition at line 39 of file buffer.c.
References buffer, len, and MEM_mallocN.
Referenced by BLI_buffer_reinit(), and BLI_buffer_resize().
|
static |
Definition at line 44 of file buffer.c.
References buffer, len, and MEM_reallocN_id.
Referenced by BLI_buffer_resize().