Adding Splitting and Coalescing in Basic Allocator in C (Malloking Pt. 2)

Introduction In previous post , We implemented basic allocator which can be used in production enviornment for very faster memory allocation queries and we took the first step towards your first billion $$$. It was perfect but lets add more code to turn your billion dollars into millions. Let’s change the strategy to improve fragmentation by adding more code (more code -> more bugs -> more loss). Hence no-code is the future. ...

May 15, 2025 · 5 min · Jay Gandhi

Building a Simple Memory Allocator Using sbrk in C (Malloking Pt. 1)

Introduction Before diving into this article, I recommend reviewing the relevant chapters from Computer Systems: A Programmer’s Perspective (CSAPP) , Chris Kanich’s lectures , and Operating Systems: Three Easy Pieces . These resources cover how memory allocation works and what happens under the hood when malloc is called. You’ll also want to understand the brk and sbrk system calls. Use any LLM if you’d like help parsing this material. this post is not a substitute for those references. ...

April 30, 2025 · 5 min · Jay Gandhi