diff --git a/src/malloc.c b/src/malloc.c index d48b053..6ec3327 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -122,12 +122,10 @@ void ft_free(void *ptr) for (i = TINY; i <= LARGE + 1; i++) { +#ifndef DEBUG if (i > LARGE) - { - // THROW ERROR write(2, "chunk not found\n", 16); - } - +#endif root = allocs_tree[i]; raw_chunk = raw_get_chunk(root, ptr); @@ -139,11 +137,10 @@ void ft_free(void *ptr) chunk_read(raw_chunk, &chunk); +#ifndef DEBUG if (chunk.is_used == false) - { write(2, "double free\n", 12); - // THROW ERROR - } +#endif // CALL THE RIGHT FREE FUNCTION DEPEND ON SIZE free_funcs[i](&chunk);