+/** Initialise heapinfo about the heapinfo pages :)
+ *
+ */
+static void initialize_heapinfo_heapinfo(xbt_mheap_t mdp)
+{
+ // Update heapinfo about the heapinfo pages (!):
+ xbt_assert((uintptr_t) mdp->heapinfo % BLOCKSIZE == 0);
+ int block = BLOCK(mdp->heapinfo);
+ size_t nblocks = mdp->heapsize * sizeof(malloc_info) / BLOCKSIZE;
+ // Mark them as free:
+ for (size_t j=0; j!=nblocks; ++j) {
+ mdp->heapinfo[block+j].type = MMALLOC_TYPE_FREE;
+ mdp->heapinfo[block+j].free_block.size = 0;
+ mdp->heapinfo[block+j].free_block.next = 0;
+ mdp->heapinfo[block+j].free_block.prev = 0;
+ }
+ mdp->heapinfo[block].free_block.size = nblocks;
+}
+