1 / 9

Administering a heap of H bytes

Administering a heap of H bytes. Address = 0. Address = H - 1. Free List Pointer :. Initial Layout. H-4. Address = 4. Address = 0. Address = H - 1. Key: Free block: Live block: Block header:. Free List Pointer :. After program requests block of size 26. 26. H-34. Address = 4.

asha
Download Presentation

Administering a heap of H bytes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Administering a heap of H bytes Address = 0 Address = H - 1 Free List Pointer :

  2. Initial Layout H-4 Address = 4 Address = 0 Address = H - 1 Key: Free block: Live block: Block header: Free List Pointer :

  3. After program requests block of size 26 26 H-34 Address = 4 Address = 34 Address = 0 Address = H - 1 Key: Free block: Live block: Block header: Free List Pointer :

  4. After program requests blocks of sizes 10, 2, 18, H-78 Minimum block size=4 bytes 26 10 4 18 H-78 Address = 4 Address = 78 Address = 0 Address = H - 1 Key: Free block: Live block: Block header: Free List Pointer : (null)

  5. After program frees one block Minimum block size=4 bytes 26 10 4 18 H-78 Address = 4 Address = 78 Address = 0 Address = H - 1 Key: Free block: Live block: Block header: Free List Pointer :

  6. After program frees a second block (free() uses LIFO policy) Minimum block size=4 bytes 26 10 4 18 H-78 Address = 4 Address = 78 Address = 0 Address = H - 1 Key: Free block: Live block: Block header: Free List Pointer :

  7. After program requests a block of size 8 (free block is split) Minimum block size=4 bytes 26 10 4 8 6 H-78 Address = 4 Address = 78 Address = 0 Address = H - 1 Key: Free block: Live block: Block header: Free List Pointer :

  8. Program frees a block (free() uses LIFO policy – interim position) Minimum block size=4 bytes 26 10 4 8 6 H-78 Address = 4 Address = 78 Address = 0 Address = H - 1 Key: Free block: Live block: Block header: Free List Pointer :

  9. Program frees a block (free() uses LIFO policy – final position) Minimum block size=4 bytes 40 4 8 6 H-78 Address = 4 Address = 78 Address = 0 Address = H - 1 Key: Free block: Live block: Block header: Free List Pointer :

More Related