This commit is contained in:
2025-02-13 13:37:18 +01:00
parent 9824c9d230
commit 561211f709
10 changed files with 94 additions and 68 deletions

25
srcs/program_end.c Normal file
View File

@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* program_end.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/10 17:11:27 by tomoron #+# #+# */
/* Updated: 2024/12/10 18:13:37 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/malloc.h"
#include <stdio.h>
void __attribute__((destructor)) malloc_end(void)
{
if (get_settings()->show_leaks)
{
ft_putstr_fd("\n\033[31m\033[1mMALLOC_SHOW_LEAKS is defined, here is \
the leak report\n", 1);
show_alloc_mem();
ft_putstr_fd("\033[0m", 1);
}
}