src/array_list.c

changeset 817
949908c97474
parent 807
c8d692131b1e
child 818
2be8fe3d5a2d
equal deleted inserted replaced
816:425234b05dff 817:949908c97474
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,

mercurial