Linux memory allocator from scratch
Trying to implement malloc, calloc, realloc, free here.
Key points:
- Have block metadata and linked list of metadata structures
- sbrk for low size and mmap for size above a threshold
- free will mark the block and will combine.
- a request will invoke the pipeline roughly 'linked list search-> split/request to os-> return block'
- a free will invoke roughly the pipeline 'mark block -> merge blocks -> return'
references: Doug Lea Malloc http://gee.cs.oswego.edu/dl/html/malloc.html
http://danluu.com/malloc-tutorial/