Malloc lab
# Malloc lab
提示
- Macros / Inline Functions
- Heap checker
__line__
- Heap checker can help you debug
- Define macros to enable/disable it conveniently
- Some examples of what a heap checker might check are:
• Is every block in the free list marked as free?
• Are there any contiguous free blocks that somehow escaped coalescing?
• Is every free block actually in the free list?
• Do the pointers in the free list point to valid free blocks?
• Do any allocated blocks overlap?
• Do the pointers in a heap block point to valid heap addresses?
- profile
- Makefile
- Don't forget to change the Makefile back
-pg
gprof
- valgrind
提示
- 程序最终以
-m32
进行编译,指针占据 4 个字节
显式空间链表
- 当前找不到合适的空间链表时,再进行合并处理
编辑 (opens new window)