29 #include "cx/array_list.h" |
29 #include "cx/array_list.h" |
30 #include "cx/compare.h" |
30 #include "cx/compare.h" |
31 #include <assert.h> |
31 #include <assert.h> |
32 #include <string.h> |
32 #include <string.h> |
33 |
33 |
|
34 // Default array reallocator |
|
35 |
|
36 static void *cx_array_default_realloc( |
|
37 void *array, |
|
38 size_t capacity, |
|
39 size_t elem_size, |
|
40 __attribute__((__unused__)) struct cx_array_reallocator_s *alloc |
|
41 ) { |
|
42 return realloc(array, capacity * elem_size); |
|
43 } |
|
44 |
|
45 struct cx_array_reallocator_s cx_array_default_reallocator = { |
|
46 cx_array_default_realloc, NULL, NULL, 0, 0 |
|
47 }; |
|
48 |
34 // LOW LEVEL ARRAY LIST FUNCTIONS |
49 // LOW LEVEL ARRAY LIST FUNCTIONS |
35 |
50 |
36 enum cx_array_copy_result cx_array_copy( |
51 enum cx_array_copy_result cx_array_copy( |
37 void **target, |
52 void **target, |
38 size_t *size, |
53 size_t *size, |