Allocator V1.0
* Allocator Version 1.0
This commit is contained in:
parent
04691819f7
commit
5d2202a0c9
20 changed files with 609 additions and 74 deletions
|
|
@ -6,13 +6,17 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/03 14:31:12 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/05/14 18:41:05 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/05/16 16:12:21 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef TYPES_H
|
||||
#define TYPES_H
|
||||
|
||||
#ifdef _FORTIFY_SOURCE
|
||||
# undef _FORTIFY_SOURCE
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue