still working on memory stuff

This commit is contained in:
Maieul BOYER 2024-05-08 19:35:13 +02:00
parent 8e90a858ad
commit 326c9318e4
No known key found for this signature in database
18 changed files with 206 additions and 77 deletions

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/07 09:48:17 by maiboyer #+# #+# */
/* Updated: 2024/05/07 22:03:02 by maiboyer ### ########.fr */
/* Updated: 2024/05/08 19:15:05 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -17,14 +17,14 @@
#include "me/types.h"
#include <stdalign.h>
#define ARENA_SIZE_DEFAULT 4096
#define ARENA_SIZE_DEFAULT 4096 * 2 * 2
typedef struct s_arena_block
{
t_usize size;
bool end;
bool free;
t_u8 padding[6];
t_usize size;
bool end;
bool used;
t_u8 padding[6];
} t_arena_block;
typedef struct s_arena_page
@ -39,6 +39,9 @@ t_arena_page *get_head_arena(void);
// Will return ERROR if it couldn't malloc the page
t_error alloc_arena_page(t_usize min_size, t_arena_page **out);
t_error get_block_for_page(t_usize size, t_arena_page *page, t_arena_block **out);
t_error get_block_for_page(t_usize size, t_arena_page *page,
t_arena_block **out);
void print_pages_info(void);
t_arena_page *get_page_from_ptr(void *ptr);
#endif /* ALLOC_INTERNAL_H */