From 3d046197c974363267d3ef149da2531eb2f7858f Mon Sep 17 00:00:00 2001 From: Arthur Pinheiro Date: Tue, 23 Aug 2022 13:54:47 +0200 Subject: [PATCH] use hashmap_new_with_allocator instead of hashmap_new in resize() Also fix small typo where seed0 was being passed as both seed0 and seed1 arguments to hashmap_new --- hashmap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hashmap.c b/hashmap.c index fa21374..6633e35 100644 --- a/hashmap.c +++ b/hashmap.c @@ -206,9 +206,10 @@ void hashmap_clear(struct hashmap *map, bool update_cap) { static bool resize(struct hashmap *map, size_t new_cap) { - struct hashmap *map2 = hashmap_new(map->elsize, new_cap, map->seed1, - map->seed1, map->hash, map->compare, - map->elfree, map->udata); + struct hashmap *map2 = hashmap_new_with_allocator(map->malloc, map->realloc, map->free, + map->elsize, new_cap, map->seed0, + map->seed1, map->hash, map->compare, + map->elfree, map->udata); if (!map2) { return false; }