Hello, Array: malloc, free and Manual Bookkeeping

Post 1 of the Dynamic Arrays in C series · Full source code on GitHub The Problem No One Starts With You have five integers. You put them in an array: 1 int numbers[5] = {10, 20, 30, 40, 50}; Done. C gives you a contiguous chunk of 20 bytes on the stack, indexed from 0 to 4, and life is good. Now your user wants to add a sixth integer. What do you do? You can’t resize a stack array. Its size was baked into the binary at compile time — the compiler saw 5, calculated 20 bytes, and that’s the space your function’s stack frame has. There’s no negotiation. You could declare int numbers[1000] and hope it’s big enough, but hope is not a memory management strategy. ...

May 24, 2026 · 17 min · pablo

What malloc() does not want you to know

Post 1 of 13 — Series: Memory Allocation and Garbage Collection from Scratch Every time you write malloc(128), something apparently magical happens: the runtime hands you a pointer to 128 bytes of memory nobody else is using. You didn’t ask the operating system for permission. You didn’t specify where those bytes should live. They simply appeared. And when you call free(), they vanish back into the void. The magic is a lie. ...

May 24, 2026 · 15 min · pablo

Hello World: Pointers, Memory, and Low-Level C

Every C project starts with a printf("Hello, World!\n");, and this blog is no exception. Welcome to pablogs.dev. I’ve been wanting to create a personal space for a while now to document my projects, organize my thoughts, and most importantly, share what I learn about systems programming and low-level C. Often, when coding in higher-level languages, we take the underlying magic for granted: how memory is allocated, how resources are cleaned up, or how data structures grow. ...

May 22, 2026 · 2 min · Pablo