Allocator is fully normed

This commit is contained in:
Maieul BOYER 2024-07-10 17:41:59 +02:00
parent fc969750e4
commit 882d5cb5bb
No known key found for this signature in database
11 changed files with 351 additions and 325 deletions

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/12 22:33:30 by maiboyer #+# #+# */
/* Updated: 2024/05/17 15:29:59 by maiboyer ### ########.fr */
/* Updated: 2024/07/10 17:24:32 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,12 +14,6 @@
#ifndef VGFUNCS
void vg_mempool_create_ext(void *pool, t_usize flags)
{
(void)(pool);
(void)(flags);
}
void vg_mempool_resize(void *pool, void *ptr, t_usize size)
{
(void)(pool);

View file

@ -0,0 +1,23 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* dummy_mempool_bis.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/12 22:33:30 by maiboyer #+# #+# */
/* Updated: 2024/07/10 17:24:39 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "aq/internal_vg_funcs.h"
#ifndef VGFUNCS
void vg_mempool_create_ext(void *pool, t_usize flags)
{
(void)(pool);
(void)(flags);
}
#endif

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/12 22:33:30 by maiboyer #+# #+# */
/* Updated: 2024/05/17 15:30:09 by maiboyer ### ########.fr */
/* Updated: 2024/07/10 17:24:19 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,18 +15,6 @@
#ifdef VGFUNCS
void vg_mempool_create_ext(void *pool, t_usize flags)
{
t_usize actual_flags;
actual_flags = 0;
if (flags & MEMPOOL_FLAG_MALLOCLIKE)
actual_flags |= VALGRIND_MEMPOOL_METAPOOL;
if (flags & MEMPOOL_FLAG_AUTOFREE)
actual_flags |= VALGRIND_MEMPOOL_AUTO_FREE;
VALGRIND_CREATE_MEMPOOL_EXT(pool, 0, ZEROED_POOL, actual_flags);
}
void vg_mempool_resize(void *pool, void *ptr, t_usize size)
{
VALGRIND_MEMPOOL_CHANGE(pool, ptr, ptr, size);

View file

@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* valgrind_mempool_bis.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/12 22:33:30 by maiboyer #+# #+# */
/* Updated: 2024/07/10 17:24:11 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "aq/internal_vg_funcs.h"
#include "valgrind/valgrind.h"
#ifdef VGFUNCS
void vg_mempool_create_ext(void *pool, t_usize flags)
{
t_usize actual_flags;
actual_flags = 0;
if (flags & MEMPOOL_FLAG_MALLOCLIKE)
actual_flags |= VALGRIND_MEMPOOL_METAPOOL;
if (flags & MEMPOOL_FLAG_AUTOFREE)
actual_flags |= VALGRIND_MEMPOOL_AUTO_FREE;
VALGRIND_CREATE_MEMPOOL_EXT(pool, 0, ZEROED_POOL, actual_flags);
}
#endif