How are malloc and free implemented?
问题 I want to implement my own dynamic memory management system in order to add new features that help to manage memory in C++. I use Windows (XP) and Linux (Ubuntu). What is needed to implement functions like 'malloc' and 'free'? I think that I have to use lowest level system calls. For Windows, I have found the functions: GetProcessHeap, HeapAlloc, HeapCreate, HeapDestroy and HeapFree. For Linux, I have not found any system calls for heap management. On Linux, malloc and free are system calls,