This is a simple C program to demonstrate dynamic memory allocation and tcache behavior in glibc.
- Allocates and frees memory using
mallocandfree. - Shows how freed chunks are reused by tcache for faster allocation.
- Demonstrates multiple allocations and reuses of memory blocks of different sizes.
gcc -g heap.c -o h
./h
gdb ./h
break main
run
heap arenas
heap chunks
heap bins