Skip to content

Instantly share code, notes, and snippets.

View iamtgiri's full-sized avatar

Tanmoy Giri iamtgiri

View GitHub Profile
@iamtgiri
iamtgiri / cpp-custom-allocators.cpp
Created February 21, 2026 20:10
A small C++ experiment comparing malloc/free with pool, arena, and hybrid custom allocators, focusing on performance when allocating and deallocating large numbers of small objects.
#include <benchmark/benchmark.h>
#include <cstdlib>
#include <new>
#include <cstddef>
#include <vector>
#include <stdexcept>
#include <cassert>
#include <algorithm>