41#ifndef __TOMMYARRAYOF_H
42#define __TOMMYARRAYOF_H
55#define TOMMY_ARRAYOF_BIT 6
101 assert(pos < array->count);
104 bsr = tommy_ilog2(pos | 1);
106 ptr = tommy_cast(
unsigned char*, array->
bucket[bsr]);
Array container type.
Definition: tommyarrayof.h:61
void * bucket[TOMMY_SIZE_BIT]
Dynamic array of buckets.
Definition: tommyarrayof.h:62
tommy_size_t count
Number of initialized elements in the array.
Definition: tommyarrayof.h:65
tommy_size_t bucket_max
Number of buckets.
Definition: tommyarrayof.h:64
tommy_uint_t bucket_bit
Bits used in the bit mask.
Definition: tommyarrayof.h:66
tommy_size_t element_size
Size of the stored element in bytes.
Definition: tommyarrayof.h:63
void * tommy_arrayof_ref(tommy_arrayof *array, tommy_size_t pos)
Gets a reference of the element at the specified position.
Definition: tommyarrayof.h:96
TOMMY_API tommy_size_t tommy_arrayof_memory_usage(tommy_arrayof *array)
Gets the size of allocated memory.
TOMMY_API void tommy_arrayof_init(tommy_arrayof *array, tommy_size_t element_size)
Initializes the array.
tommy_size_t tommy_arrayof_size(tommy_arrayof *array)
Gets the initialized size of the array.
Definition: tommyarrayof.h:115
TOMMY_API void tommy_arrayof_grow(tommy_arrayof *array, tommy_size_t size)
Grows the size up to the specified value.
struct tommy_arrayof_struct tommy_arrayof
Array container type.
TOMMY_API void tommy_arrayof_done(tommy_arrayof *array)
Deinitializes the array.
uint64_t tommy_size_t
Generic size_t type.
Definition: tommytypes.h:60
tommy_uint32_t tommy_uint_t
Generic unsigned integer type.
Definition: tommytypes.h:80