- { /* create the mutex within that heap */
- void *old_heap = mmalloc_get_current_heap();
- mmalloc_set_current_heap(mbase);
- mdp->mutex = xbt_os_mutex_init();
- mmalloc_set_current_heap(old_heap);
- }
+ /* Add the new heap to the linked list of heaps attached by mmalloc */
+ if(__mmalloc_default_mdp){
+ mdp = __mmalloc_default_mdp;
+ while(mdp->next_mdesc)
+ mdp = mdp->next_mdesc;