41 #ifndef __TOMMYARRAYOF_H
42 #define __TOMMYARRAYOF_H
55 #define TOMMY_ARRAYOF_BIT 6
60 #define TOMMY_ARRAYOF_BIT_MAX 32
101 assert(pos < array->count);
106 ptr = tommy_cast(
unsigned char*, array->
bucket[bsr]);
tommy_uint_t bucket_bit
Bits used in the bit mask.
Definition: tommyarrayof.h:69
tommy_uint_t tommy_ilog2_u32(tommy_uint32_t value)
Bit scan reverse or integer log2.
Definition: tommytypes.h:331
tommy_count_t count
Number of initialized elements in the array.
Definition: tommyarrayof.h:71
void tommy_arrayof_init(tommy_arrayof *array, tommy_size_t element_size)
Initializes the array.
tommy_uint32_t tommy_count_t
Generic unsigned integer for counting objects.
Definition: tommytypes.h:67
void * tommy_arrayof_ref(tommy_arrayof *array, tommy_count_t pos)
Gets a reference of the element at the specified position.
Definition: tommyarrayof.h:96
tommy_count_t tommy_arrayof_size(tommy_arrayof *array)
Gets the initialized size of the array.
Definition: tommyarrayof.h:114
tommy_count_t bucket_max
Number of buckets.
Definition: tommyarrayof.h:70
tommy_size_t tommy_arrayof_memory_usage(tommy_arrayof *array)
Gets the size of allocated memory.
tommy_size_t element_size
Size of the stored element in bytes.
Definition: tommyarrayof.h:68
void tommy_arrayof_grow(tommy_arrayof *array, tommy_count_t size)
Grows the size up to the specified value.
Array container type.
Definition: tommyarrayof.h:66
tommy_uint32_t tommy_uint_t
Generic unsigned integer type.
Definition: tommytypes.h:60
struct tommy_arrayof_struct tommy_arrayof
Array container type.
void * bucket[TOMMY_ARRAYOF_BIT_MAX]
Dynamic array of buckets.
Definition: tommyarrayof.h:67
size_t tommy_size_t
Generic size_t type.
Definition: tommytypes.h:50
void tommy_arrayof_done(tommy_arrayof *array)
Deinitializes the array.