How adn-dodo/custom-hmm works
HMM is a C heap allocator that manages memory with sbrk(). A caller can use its allocator API directly or go through the standard-library wrappers: allocation searches and grows the heap, while freeing coalesces blocks and may trim the heap. The API also provides zeroed allocation, reallocation, and usable-size lookup. The graph reflects the sampled runtime source and README; it omits build and verification machinery. The system-break dependency is explicit, but no source for the external OS service is present.
Main entry points: heapWrappers.c Standard wrappers · HmmAlloc.c Allocate · HmmFree.c Free and coalesce
Components 7
Allocator API
- Standard wrappers
src/heapWrappers.c
Heap engine
- Allocate
src/HmmAlloc.c - Free and coalesce
src/HmmFree.c - Calloc, realloc, size
src/HmmAlloc.c
Heap state
- Blocks and free list
src/HmmAlloc.c
Other components
- Application
- OS program break
Connections 10
- Application → Standard wrappers: calls
README.md - Standard wrappers → Allocate: dispatches malloc
src/heapWrappers.c - Standard wrappers → Free and coalesce: dispatches free
src/heapWrappers.c - Standard wrappers → Calloc, realloc, size: dispatches calloc/realloc
src/heapWrappers.c - Allocate → Blocks and free list: searches and updates
src/HmmAlloc.c - Free and coalesce → Blocks and free list: coalesces and updates
src/HmmFree.c - Calloc, realloc, size → Allocate: allocates
src/HmmAlloc.c - Calloc, realloc, size → Free and coalesce: frees on realloc
src/HmmAlloc.c - Allocate → OS program break: grows with sbrk
src/HmmAlloc.c - Free and coalesce → OS program break: trims with sbrk
src/HmmFree.c