update stuff

This commit is contained in:
Maieul BOYER 2024-08-03 00:00:42 +02:00
parent 24b210fe86
commit 709c124028
No known key found for this signature in database
20 changed files with 176 additions and 64 deletions

40
output/src/hashmap/env/env_clear.c vendored Normal file
View file

@ -0,0 +1,40 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* hashmap_env.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/06 11:00:22 by maiboyer #+# #+# */
/* Updated: 2023/12/11 15:24:44 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "me/types.h"
#include "me/hashmap/hashmap_env.h"
#include "me/mem/mem.h"
void hmap_env_clear(t_hashmap_env *self)
{
t_usize bucket_id;
t_entry_env *cur;
t_entry_env *next;
bucket_id = 0;
while (bucket_id < self->num_buckets)
{
cur = self->buckets[bucket_id];
while (cur != NULL)
{
next = cur->next;
self->free(cur->kv);
mem_free(cur);
cur = next;
}
bucket_id++;
}
}