Posts

Showing posts from December 25, 2018

Simple Malloc Implementation

Image
1 I've written an implementation of malloc , realloc , and free . I wanted to make a malloc implementation that is sufficiently simple and easy to maintain. I don't care so much for performance, but I'd like to know if anything stands out that can easily be fixed. An explanation of how it works is in the source file. Other malloc reviews I've seen on this site use linked lists, but just note that this implementation does not. The prefix alloy is the name of the project, so if you see it in the global functions, that's what it means and you can ignore it. Here's malloc.h #ifndef alloy_malloc_h #define alloy_malloc_h #ifdef __cplusplus extern "C" { #endif #ifndef NULL /** This value represents an invalid memory address. * It contains a value of zero, by default. Zero