What you've learned

You should now know how to:

  • Explain how dynamic memory allocation and the C heap works
  • Write a simple dynamic memory allocator
  • Explain some of the risks of heap allocation in general

Knowledge Check

What is one difference between static and dynamic memory allocation?

Do C's memory management functions like `malloc` and `free` validate the addresses passed to them?

If the allocator was used mainly for very small allocations (less than 8 bytes), what concern would you have?