Put the custom allocator in its own lib, as to lessen the difficulty to switch between libc's allocator and a custom one (#7)
This commit is contained in:
parent
713f0f0302
commit
cb7f3c3fdf
85 changed files with 1121 additions and 877 deletions
9
output/src/hashmap/env/env_utils.c
vendored
9
output/src/hashmap/env/env_utils.c
vendored
|
|
@ -1,19 +1,18 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* hashmap_env_utils.c :+: :+: :+: */
|
||||
/* env_utils.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/12/06 10:58:20 by maiboyer #+# #+# */
|
||||
/* Updated: 2023/12/11 15:35:37 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/05/14 18:47:08 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/hash/sip.h"
|
||||
#include "me/hashmap/hashmap_env.h"
|
||||
#include "me/mem/mem_alloc.h"
|
||||
#include "me/mem/mem_alloc_array.h"
|
||||
#include "me/mem/mem.h"
|
||||
#include "me/mem/mem_copy.h"
|
||||
#include "me/types.h"
|
||||
#include <stdlib.h>
|
||||
|
|
@ -51,6 +50,6 @@ void remove_hashmap_env(t_hashmap_env *hmap, t_str *key)
|
|||
else
|
||||
prev->next = entry->next;
|
||||
hmap->drop(entry->kv);
|
||||
me_free(entry);
|
||||
mem_free(entry);
|
||||
hmap->buckets[hashed_key % hmap->num_buckets] = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue