Made a memory allocator (crude)
This commit is contained in:
parent
b5c7344851
commit
941bac31b6
53 changed files with 469 additions and 146 deletions
|
|
@ -6,21 +6,14 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/12/06 14:47:49 by maiboyer #+# #+# */
|
||||
/* Updated: 2023/12/09 18:14:11 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/05/07 12:45:31 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/mem/mem_alloc.h"
|
||||
#include <stdlib.h>
|
||||
#include "me/alloc/alloc.h"
|
||||
|
||||
void *mem_alloc(t_usize size)
|
||||
{
|
||||
void *out;
|
||||
size_t i;
|
||||
|
||||
i = 0;
|
||||
out = malloc(size);
|
||||
while (out && i < size)
|
||||
((t_u8 *)out)[i++] = 0;
|
||||
return (out);
|
||||
return (me_malloc(size));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue