src/array_list.c

changeset 817
949908c97474
parent 807
c8d692131b1e
child 818
2be8fe3d5a2d
     1.1 --- a/src/array_list.c	Mon Jan 22 19:34:38 2024 +0100
     1.2 +++ b/src/array_list.c	Wed Jan 24 22:19:05 2024 +0100
     1.3 @@ -31,6 +31,21 @@
     1.4  #include <assert.h>
     1.5  #include <string.h>
     1.6  
     1.7 +// Default array reallocator
     1.8 +
     1.9 +static void *cx_array_default_realloc(
    1.10 +        void *array,
    1.11 +        size_t capacity,
    1.12 +        size_t elem_size,
    1.13 +        __attribute__((__unused__)) struct cx_array_reallocator_s *alloc
    1.14 +) {
    1.15 +    return realloc(array, capacity * elem_size);
    1.16 +}
    1.17 +
    1.18 +struct cx_array_reallocator_s cx_array_default_reallocator = {
    1.19 +        cx_array_default_realloc, NULL, NULL, 0, 0
    1.20 +};
    1.21 +
    1.22  // LOW LEVEL ARRAY LIST FUNCTIONS
    1.23  
    1.24  enum cx_array_copy_result cx_array_copy(

mercurial