What do never malloc'd chunks look like in glibc malloc?

Viewed 25

I had assumed that glibc would treat the never allocated chunk of the heap as if it was free()d, populating it with pointers for the free list. So that, if the initial unallocated heap is 0x1000 bytes, and malloc allocates the first 0x400, we'd see a second chunk beginning at 0x400 with fd and bk pointers.

However, experimentation suggests that this is not true, and that the never allocated chunk does not have pointers.

  1. Is that correct?
  2. If so, how does malloc keep track of it, its size, and know when to take from it and when not to?
  3. Is this the same thing as the wilderness chunk?
0 Answers
Related