/** * @file malloc.h * @brief Public interface for the ft_malloc allocator. * * Declares malloc, free, realloc, and show_alloc_mem with the same * prototypes as their libc counterparts so the library can be used * as a drop-in replacement via LD_PRELOAD. */ #ifndef MALLOC_H #define MALLOC_H #include /** @brief Release the memory block at @p ptr. */ void free (void *ptr); /** @brief Allocate @p size bytes and return a pointer to them. */ void *malloc (size_t size); /** * @brief Resize the block at @p ptr to @p size bytes. * @return Pointer to the (possibly moved) block, or NULL on failure. */ void *realloc (void *ptr, size_t size); /** * @brief Print every allocated zone and block to stdout, sorted by * ascending address. */ void show_alloc_mem (void); #endif