Skip to content

Commit

Permalink
Merge branch 'js/reftable-realloc-errors-fix'
Browse files Browse the repository at this point in the history
Last-minute fix to a recent update.

* js/reftable-realloc-errors-fix:
  t-reftable-basics: allow for `malloc` to be `#define`d
  • Loading branch information
gitster committed Jan 8, 2025
2 parents e05e111 + d02c37c commit a60673e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions t/unit-tests/t-reftable-basics.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)

old_alloc = alloc;
old_arr = arr;
reftable_set_alloc(malloc, realloc_stub, free);
reftable_set_alloc(NULL, realloc_stub, NULL);
check(REFTABLE_ALLOC_GROW(arr, old_alloc + 1, alloc));
check(arr == old_arr);
check_uint(alloc, ==, old_alloc);

old_alloc = alloc;
reftable_set_alloc(malloc, realloc, free);
reftable_set_alloc(NULL, NULL, NULL);
check(!REFTABLE_ALLOC_GROW(arr, old_alloc + 1, alloc));
check(arr != NULL);
check_uint(alloc, >, old_alloc);
Expand All @@ -188,11 +188,11 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
arr[alloc - 1] = 42;

old_alloc = alloc;
reftable_set_alloc(malloc, realloc_stub, free);
reftable_set_alloc(NULL, realloc_stub, NULL);
REFTABLE_ALLOC_GROW_OR_NULL(arr, old_alloc + 1, alloc);
check(arr == NULL);
check_uint(alloc, ==, 0);
reftable_set_alloc(malloc, realloc, free);
reftable_set_alloc(NULL, NULL, NULL);

reftable_free(arr);
}
Expand Down

0 comments on commit a60673e

Please sign in to comment.