c++ - How are malloc and free implemented? -


I want to implement my own dynamic memory management system so that it can add new features that can be used in C ++ memory Let's help in the management.

I use Windows (XP) and Linux (Ubuntu) to implement tasks like 'Molk' and 'Free'. I think I have to use the lowest level system call.

For Windows, I've got the task: GetProcessHeap, HeapAlloc, HeapCreate, HeapDestroy and HeapFree.

For Linux, I have no system call for heap management

edit:
C ++ garbage collector and trash The collector does not provide, Linux, Molok and system calls for free? Is slow. Some allocation is easy to free, but the allocation is that a garbage collector is needed.

I want to implement these functions and add new features:
* Whenever called free (), check whether the indicator falls under the heap.
* Help with garbage collection. I have to store some information about allocated blocks.
* Use Multiple Stacks (Hepcat / Hypdstore on Windows) I can quickly remove an entire heap with my allocated blocks.

On Linux, Maulok and Free System are not saying Receives malloc / free memory from the kernel, and with the brk system call as well as receiving anonymous memory with mmap - and malloc, increasing the data segment and shrinking it (If it can be) manage memory in those areas, some basic information can be found in any great context.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -