?? todo
字號(hào):
0. Access data structures with accessor macros, then turn the heapinfointo several arrays for faster access on machines with addressing modes.Also, this eventually raises the possibility of maintaining multipleheaps.1. Possible heuristic to catch multiple frees. Introduce an extra wordof heapinfo that says whether the remaining info is for somethingbusy or something free. Then we can catch attempts to free already-freelarge blocks, as well as things not belonging to malloc at all. In thecase of a fragment, we can check if the fragment looks like it *already*belongs to the fragment list, by comparing it with the "first" fragmentof the block, or checking its "prev" pointer to see if it points intothe block. Then if it looks like it might we can exhaustively searchthe block's free list to see if the fragment is there or not. Extendingthe heapinfo structure would have the benefit of making it a power oftwo and thus making array indexing faster, perhaps. Suitably adapted,this heuristic could also catch invalid pointers passed to realloc.All of these additional features require the inclusion of <malloc.h>.3. indirect reference allocator: ialloc(), ifree(), irealloc().4. garbage collecting allocator: galloc(), garbage(), gfree(), grealloc().
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -