Description: C++ simulated memory allocation
A, thinking
To simulate the memory allocation and release of the compiled system, implement some simple operations. First using a static array simulation memory space (buf), when the calling application memory operations, from the array space (buf) returned to the caller of a certain space, when the free memory, memory tag specifies part is unused.
1. Distribution rules
Each allocated or freed memory is recorded by MemInfo and saved in an array (buf) as the "head" of memory space, followed by data. MemInfo consists of a list structure with the header not occupying the array space (buf). When the caller application memory, will lead to MemInfo list traversal, traverse the purpose is to find a "memory fragments", if "debris" size is available, to use the "fragments", returned to the caller.
2. Release rules
When each block of memory is released, simply mark the data area as useless and do not delete the MemInfo linked list node, which can be reused to avoid multiple MemInfo linked list operations.
To Search:
- [memorymanager] - This is a memory allocation management p
- [game_Pushbox] - C development Tuixiangzi a game. Class d
- [MemTracker] - err
- [WORK] - Simulation of memory allocation ~ ~ use
- [LinkList] - With c++ Write operation of a single lin
- [tiny15] - ATtiny15L Instruction Set Summary.
- [52] - Static LED screen test procedure. Throug
File list (Check if you may need any files):