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
|
|
@ -6,14 +6,25 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/12/06 14:47:49 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/05/07 12:45:31 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/05/14 18:32:31 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/mem/mem_alloc.h"
|
||||
#include "me/alloc/alloc.h"
|
||||
#include "me/mem/_allocator.h"
|
||||
|
||||
void *mem_alloc(t_usize size)
|
||||
void *mem_alloc(t_usize size)
|
||||
{
|
||||
return (me_malloc(size));
|
||||
t_allocator *a;
|
||||
|
||||
a = global_allocator();
|
||||
return (a->alloc(a, size));
|
||||
}
|
||||
|
||||
void mem_free(void *ptr)
|
||||
{
|
||||
t_allocator *a;
|
||||
|
||||
a = global_allocator();
|
||||
return (a->free(a, ptr));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue