From 1909954b4212cc9e0f87e7add0d7aa3cce60691c Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Sat, 4 May 2024 09:44:46 -0400 Subject: [PATCH] merge amt --- tests/soak.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/soak.c b/tests/soak.c index 7f579f6..488c7a7 100644 --- a/tests/soak.c +++ b/tests/soak.c @@ -633,10 +633,11 @@ sparsemap_idx_t _sparsemap_merge(sparsemap_t **map, sparsemap_t *other) { do { - int retval = sparsemap_merge(*map, other); + ssize_t retval = sparsemap_merge(*map, other); if (retval != 0) { if (errno == ENOSPC) { - *map = sparsemap_set_data_size(*map, sparsemap_get_capacity(*map) + 64, NULL); + size_t new_size = retval + (64 - (retval % 64)) + 64; + *map = sparsemap_set_data_size(*map, sparsemap_get_capacity(*map) + , NULL); assert(*map != NULL); errno = 0; } else {