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:
Maix0 2024-05-14 18:56:53 +02:00 committed by GitHub
parent 713f0f0302
commit cb7f3c3fdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
85 changed files with 1121 additions and 877 deletions

View file

@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* _allocator.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/14 18:27:07 by maiboyer #+# #+# */
/* Updated: 2024/05/14 18:27:40 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef _ALLOCATOR_H
#define _ALLOCATOR_H
#include "aq/allocator.h"
t_allocator *global_allocator(void);
void uninit_global_allocator(void);
#endif /* _ALLOCATOR_H */

View file

@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* mem.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/14 18:32:57 by maiboyer #+# #+# */
/* Updated: 2024/05/14 18:39:13 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MEM_H
#define MEM_H
#include "me/types.h"
void *mem_alloc(t_usize size);
void *mem_alloc_array(t_usize size, t_usize count);
void *mem_realloc(void *ptr, t_usize size);
void *mem_realloc_array(void *ptr, t_usize size, t_usize count);
void mem_free(void *ptr);
#endif /* MEM_H */