Allocator V1.0

* Allocator Version 1.0
This commit is contained in:
Maix0 2024-05-18 15:05:28 +02:00 committed by GitHub
parent 04691819f7
commit 5d2202a0c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 609 additions and 74 deletions

View file

@ -6,12 +6,17 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/14 18:26:27 by maiboyer #+# #+# */
/* Updated: 2024/05/14 18:28:24 by maiboyer ### ########.fr */
/* Updated: 2024/05/16 16:24:54 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "aq/internal_vg_funcs.h"
#include "me/types.h"
#include "aq/allocator.h"
#include "aq/libc_wrapper.h"
#include "aq/melloc.h"
t_allocator *global_allocator(void)
{
@ -20,7 +25,7 @@ t_allocator *global_allocator(void)
if (!init)
{
init = true;
global_alloc = lc_init();
global_alloc = m_init();
}
return (&global_alloc);
}
@ -30,5 +35,6 @@ void uninit_global_allocator(void)
t_allocator *allocator;
allocator = global_allocator();
vg_mem_defined(allocator, sizeof(*allocator));
allocator->uninit(allocator);
}

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/07 11:08:03 by maiboyer #+# #+# */
/* Updated: 2024/05/14 18:42:15 by maiboyer ### ########.fr */
/* Updated: 2024/05/16 17:26:27 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -93,5 +93,6 @@ void me_abort(t_str msg)
me_putstr_fd("Abort: ", 2);
me_putendl_fd(msg, 2);
print_trace();
me_exit(1);
// me_exit(1);
abort();
}

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/07 13:08:52 by maiboyer #+# #+# */
/* Updated: 2024/05/14 18:42:41 by maiboyer ### ########.fr */
/* Updated: 2024/05/16 17:12:46 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */