41 #ifndef __TOMMYARRAYBLK_H
42 #define __TOMMYARRAYBLK_H
55 #define TOMMY_ARRAYBLK_SIZE (4 * 1024)
91 assert(pos < array->count);
void tommy_arrayblk_insert(tommy_arrayblk *array, void *element)
Grows and inserts a new element at the end of the array.
Definition: tommyarrayblk.h:121
tommy_uint32_t tommy_count_t
Generic unsigned integer for counting objects.
Definition: tommytypes.h:67
void tommy_arrayblk_set(tommy_arrayblk *array, tommy_count_t pos, void *element)
Sets the element at the specified position.
Definition: tommyarrayblk.h:103
void tommy_arrayblk_done(tommy_arrayblk *array)
Deinitializes the array.
Dynamic array based on segments of exponential growing size.
void * tommy_arrayblk_get(tommy_arrayblk *array, tommy_count_t pos)
Gets the element at the specified position.
Definition: tommyarrayblk.h:113
struct tommy_arrayblk_struct tommy_arrayblk
Array container type.
#define TOMMY_ARRAYBLK_SIZE
Elements for each block.
Definition: tommyarrayblk.h:55
void * tommy_array_get(tommy_array *array, tommy_count_t pos)
Gets the element at the specified position.
Definition: tommyarray.h:120
tommy_count_t tommy_arrayblk_size(tommy_arrayblk *array)
Gets the initialized size of the array.
Definition: tommyarrayblk.h:133
void ** tommy_arrayblk_ref(tommy_arrayblk *array, tommy_count_t pos)
Gets a reference of the element at the specified position.
Definition: tommyarrayblk.h:87
tommy_count_t count
Number of initialized elements in the array.
Definition: tommyarrayblk.h:63
void tommy_arrayblk_init(tommy_arrayblk *array)
Initializes the array.
tommy_array block
Array of blocks.
Definition: tommyarrayblk.h:62
size_t tommy_size_t
Generic size_t type.
Definition: tommytypes.h:50
Array container type.
Definition: tommyarrayblk.h:61
Array container type.
Definition: tommyarray.h:65
tommy_size_t tommy_arrayblk_memory_usage(tommy_arrayblk *array)
Gets the size of allocated memory.
void tommy_arrayblk_grow(tommy_arrayblk *array, tommy_count_t size)
Grows the size up to the specified value.