wm.WILLIAM MARAISLet’s talk ↗
← All projects
SYSTEMS / LEARNING

Under the allocation.

A compact systems programming exercise exploring the mechanics behind memory allocation and deallocation. The focus is understanding ownership, tracking allocated blocks and cleanup.

STATUSLearning project
TOOLS & TECHNOLOGIESC++ / Memory management / Valgrind

Learning objective

Implementing allocation primitives makes normally hidden details concrete: block bookkeeping, allocation lifetime and the relationship between an address and the storage behind it.

Validation focus

Memory tools help reveal leaks and invalid accesses. Small programs that allocate, use and release multiple blocks provide a practical way to reason about allocator behaviour.

Scope

This is an educational implementation, not a production allocator. The project is intentionally small and complements broader work in C++ systems programming.

EXPLORE THE SOURCE

Explore the implementation

View repository ↗
git clone https://github.com/SAED2906/MemoryAllocator.git

Code example

example.cppC++
#include "memalloc.h"
#include <iostream>

int main() {
    int* values = (int*) malloc(5 * sizeof(int));
    if (values == nullptr) return 1;

    for (int i = 0; i < 5; ++i) {
        values[i] = i + 1;
        std::cout << values[i] << '\n';
    }

    global_free();
    return 0;
}

NEXT PROJECTQAS — Quantum Architecture Search ↗