[prev] 6 [next]

Dynamic Allocation (cont)

Implementing C-like malloc() and free() in MIPS requires
  • a complete implementation of C's heap management, i.e.
  • a large region of memory to manage (syscall 9)
  • ability to mark chunks of this region as "in use" (with size)
  • ability to maintain list of free chunks
  • ability to merge free chunks to prevent fragmentation

[Diagram:Pics/processor/heap.png]