|
|
|
|
|
by Agingcoder
1858 days ago
|
|
It depends on your allocator - ptmalloc, the default linux allocator - is open source, and there's plenty of very robust open allocators (jemalloc, mimalloc, tcmalloc, etc). Understanding how your allocator works can be very important in certain contexts. On windows I'd expect the default allocator to be a black box, but I might be wrong. For garbage collection I strongly recommend this book (on top of the source code of your gc if available!)
https://gchandbook.org/ |
|
The UCRT is at least "source available" on Windows, up to a point, and distributed with the Windows SDK. The release heap codepath is a bit boring:
The debug codepath is a bit more interesting: HeapAlloc itself is a bit more of a black box (AFAIK), and contains a lot of the fun details about the actual process of heap allocation - although there's a bunch of hooks, debug functions, documentation, articles, alternative implementations (ReactOS), etc.