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
|
|
@ -1,30 +0,0 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* list_free_all.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/09 21:35:20 by maiboyer #+# #+# */
|
||||
/* Updated: 2023/12/09 15:03:34 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/list/list_free_all.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
void list_free_all(t_list **lst, void (*del)(void *))
|
||||
{
|
||||
t_list *tmp;
|
||||
|
||||
if (lst == NULL || del == NULL)
|
||||
return ;
|
||||
while (*lst)
|
||||
{
|
||||
del((*lst)->content);
|
||||
tmp = *lst;
|
||||
*lst = (*lst)->next;
|
||||
me_free(tmp);
|
||||
}
|
||||
*lst = NULL;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue