Allocator APIs and memory regions

Follow one malloc call through the program, its allocator and the kernel, then see how freed blocks are reused, merged and sometimes misused. Memory management foundations · Operating systems.

A tiny malloc call may be answered from an old block, may grow the heap, or may map new memory. Which layer decides, and what happens to the memory after free?

What you will learn

  • Separate the roles of the program, the allocator and the kernel
  • Trace a request that is served from the pool and one that grows the program break
  • Explain headers, merging and the bugs caused by lifetimes that disagree

Lesson outline

  1. Three layers behind one call
  2. Serving a request and growing the pool
  3. Headers and merging
  4. When lifetimes disagree

16 minutes · 3 scenes · 0 predict checks · 11 quiz questions

The full lesson is available with Premium.