memorybook functionnal, with add

This commit is contained in:
Hugo LAMY
2022-03-25 21:27:24 +01:00
parent 02b5d88ea5
commit f645da7885
9 changed files with 113 additions and 110 deletions

View File

@@ -8,6 +8,7 @@
# include <stdio.h> // for printf()
# include "colors.h"
# include "memorybook.h"
# include "cube3d_macro.h"
# include "cube3d_struct.h"

View File

@@ -45,14 +45,4 @@ int is_go_backward(int *k_hook);
// draw.c
void draw(t_game *game);
// -------------------------------
// SRC/MEM
// -------------------------------
// g_alloc_free_exit.c
void gexit_init(void(*f)(void*), void *param);
void *gmalloc(size_t size);
void gfree(void *addr);
void gexit(char *str);
#endif

18
headers/memorybook.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef MEMORYBOOK_H
# define MEMORYBOOK_H
typedef void(*t_mb_func_exit)(void*);
typedef struct s_exit
{
t_mb_func_exit f;
void *param;
} t_exit;
void mb_init(void(*f)(void*), void *param);
void *mb_alloc(size_t size);
void mb_add(void *addr);
void mb_free(void *addr);
void mb_exit(char *str);
#endif