custom_mem_alloc · C compiled to WebAssembly

A malloc you can watch

Every button calls the real my_malloc, my_calloc or my_free from src/my_allocator.c. The map is redrawn from the allocator's own print_heap_metadata() after each call.

The 1 MB arena

arena start
allocated payload selected free header
0bytes allocated
0bytes free
0largest free block
0blocks
0%fragmentation

Allocate

Misuse

These abort, exactly as they do natively. The page then restarts the module, the way a crashed process would be restarted.


    

Live pointers

pointerrequestedblock

nothing allocated

Benchmark, inside WebAssembly

The workload from bench/workload.h: random allocate and free across 256 slots, every block filled and verified before it is freed. Compared against Emscripten's own malloc.

allocatorns / opM ops / sfailed