src/array_list.c

changeset 804
5136f2fc32ec
parent 764
ccbdbd088455
child 807
c8d692131b1e
     1.1 --- a/src/array_list.c	Fri Jan 12 20:24:29 2024 +0100
     1.2 +++ b/src/array_list.c	Sat Jan 13 17:51:42 2024 +0100
     1.3 @@ -107,6 +107,8 @@
     1.4  #define CX_ARRAY_SWAP_SBO_SIZE 128
     1.5  #endif
     1.6  
     1.7 +bool CX_DISABLE_ARRAY_LIST_SWAP_SBO = false;
     1.8 +
     1.9  void cx_array_swap(
    1.10          void *arr,
    1.11          size_t elem_size,
    1.12 @@ -122,7 +124,7 @@
    1.13      void *tmp;
    1.14  
    1.15      // decide if we can use the local buffer
    1.16 -    if (elem_size > CX_ARRAY_SWAP_SBO_SIZE) {
    1.17 +    if (elem_size > CX_ARRAY_SWAP_SBO_SIZE || CX_DISABLE_ARRAY_LIST_SWAP_SBO) {
    1.18          tmp = malloc(elem_size);
    1.19          // we don't want to enforce error handling
    1.20          if (tmp == NULL) abort();

mercurial