hopefully a working allocator !
This commit is contained in:
parent
a149e9a860
commit
b639b0c14e
8 changed files with 53 additions and 35 deletions
4
output/src/hashmap/env/env.c
vendored
4
output/src/hashmap/env/env.c
vendored
|
|
@ -32,7 +32,9 @@ t_hashmap_env *new_hashmap_with_buckets_env(
|
|||
t_drop_env_fn drop, t_usize buckets)
|
||||
{
|
||||
t_hashmap_env *hmap;
|
||||
t_usize i;
|
||||
|
||||
i = 0;
|
||||
hmap = mem_alloc(sizeof(*hmap));
|
||||
if (hmap == NULL)
|
||||
return (NULL);
|
||||
|
|
@ -44,6 +46,8 @@ t_hashmap_env *new_hashmap_with_buckets_env(
|
|||
hmap->drop = drop;
|
||||
if (hmap->buckets == NULL)
|
||||
return ((void)me_free(hmap), NULL);
|
||||
while (i < buckets)
|
||||
hmap->buckets[i++] = NULL;
|
||||
return (hmap);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue