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
29
allocator/include/aq/libc_wrapper.h
Normal file
29
allocator/include/aq/libc_wrapper.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* libc_wrapper.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/14 17:52:11 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/05/14 18:48:06 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef LIBC_WRAPPER_H
|
||||
#define LIBC_WRAPPER_H
|
||||
|
||||
#include "aq/allocator.h"
|
||||
#include "me/types.h"
|
||||
|
||||
void *lc_malloc(t_allocator *self, t_usize size);
|
||||
void *lc_calloc(t_allocator *self, t_usize size, t_usize count);
|
||||
void *lc_realloc(t_allocator *self, void *ptr, t_usize min_size);
|
||||
void *lc_realloc_array(t_allocator *self, void *ptr, t_usize size,
|
||||
t_usize count);
|
||||
void lc_free(t_allocator *self, void *ptr);
|
||||
void lc_uninit(t_allocator *self);
|
||||
|
||||
t_allocator lc_init(void);
|
||||
|
||||
#endif /* LIBC_WRAPPER_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue