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
32
allocator/src/lc_alloc/functions2.c
Normal file
32
allocator/src/lc_alloc/functions2.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* functions2.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/14 18:06:34 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/05/14 18:48:41 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "aq/allocator.h"
|
||||
#include "aq/libc_wrapper.h"
|
||||
|
||||
void lc_uninit(t_allocator *self)
|
||||
{
|
||||
(void)(self);
|
||||
}
|
||||
|
||||
t_allocator lc_init(void)
|
||||
{
|
||||
return ((t_allocator){
|
||||
.alloc = lc_malloc,
|
||||
.alloc_array = lc_calloc,
|
||||
.realloc = lc_realloc,
|
||||
.realloc_array = lc_realloc_array,
|
||||
.free = lc_free,
|
||||
.uninit = lc_uninit,
|
||||
.alloc_data = NULL,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue