Lines Matching refs:element_size
30 size_t element_size; member
41 array_t *array_new(size_t element_size) { in array_new() argument
42 assert(element_size > 0); in array_new()
44 array_t *array = osi_calloc(sizeof(array_t) + element_size * INTERNAL_ELEMENTS); in array_new()
46 …ERROR("%s unable to allocate memory for array with elements of size %zu.", __func__, element_size); in array_new()
50 array->element_size = element_size; in array_new()
73 return array->data + (index * array->element_size); in array_at()
90 …st current capacity of %zu elements of size %zu.", __func__, array->capacity, array->element_size); in array_append_ptr()
95 memcpy(array_at(array, array->length - 1), data, array->element_size); in array_append_ptr()
103 void *new_data = realloc(is_moving ? NULL : array->data, new_capacity * array->element_size); in grow()
108 memcpy(new_data, array->internal_storage, array->length * array->element_size); in grow()