Creating my first malloc - Phase 1 Mini Malloc
In this part, I am going to make a simple bump allocator that just allocates memory. Note: The clues I mention below were given to me by an AI assistant, used purely to guide my understanding of co...

Source: DEV Community
In this part, I am going to make a simple bump allocator that just allocates memory. Note: The clues I mention below were given to me by an AI assistant, used purely to guide my understanding of concepts and syntax. The entire code is written by me, referencing the official glibc documentation throughout. I'm mentioning this explicitly because I believe in being honest about the learning process. The entire process and my code has been uploaded on my github account: [https://github.com/moonlitpath1/mini-malloc] Clues that I've got: Create mymalloc.c. You need **two* functions (not one):* #include <unistd.h> #include <stddef.h> void *malloc(size_t size) { // your 3-line bump allocator here } void free(void *ptr) { // intentionally empty for now — but must exist } Why does free need to exist even empty? When ls runs, it calls free() on memory it allocated. If you don't provide free, your .so has no free symbol, so the linker falls back to glibc's free — which will try to read