Dynamic Memory Allocation
1 Dynamic Memory Allocation
Outline Implementation of a simple allocator Explicit Free List Segregated Free List 5 uggested reading:10.9,10.10,.10.110.12, 10.13 Segregate:隔离
2 Outline • Implementation of a simple allocator • Explicit Free List • Segregated Free List • Suggested reading: 10.9, 10.10, 10.11, 10.12, 10.13 Segregate:隔离
ynamic Memory Allocation P731 Explicit Vs. Implicit Memory Allocator Explicit: application allocates and frees space E.g., malloc and free in C Implicit: application allocates, but does not free space E.g. garbage collection in Java, ML or Lisp
3 Dynamic Memory Allocation P731 • Explicit vs. Implicit Memory Allocator – Explicit: application allocates and frees space • E.g., malloc and free in C – Implicit: application allocates, but does not free space • E.g. garbage collection in Java, ML or Lisp
Dynamic Memory Allocation Allocation In both cases the memory allocator provides an abstraction of memory as a set of blocks Doles out free memory blocks to application Doles:发放
4 Dynamic Memory Allocation • Allocation – In both cases the memory allocator provides an abstraction of memory as a set of blocks – Doles out free memory blocks to application Doles: 发放
10.9. 1 The malloc and free Functions
5 10.9.1 The malloc and free Functions