mdp->next_mdesc = NULL;
mdp->options = options;
- pthread_mutex_init(&mdp->mutex, NULL);
/* If we have not been passed a valid open file descriptor for the file
to map to, then open /dev/zero and use that to map to. */
while(mdp->next_mdesc)
mdp = mdp->next_mdesc;
- LOCK(mdp);
mdp->next_mdesc = (struct mdesc *)mbase;
- UNLOCK(mdp);
}
return mbase;
}
-
-
-/** Terminate access to a mmalloc managed region, but do not free its content.
- *
- * This is for example useful for the base region where ldl stores its data
- * because it leaves the place after us.
- */
-void xbt_mheap_destroy_no_free(xbt_mheap_t md)
-{
- struct mdesc *mdp = md;
-
- pthread_mutex_destroy(&mdp->mutex);
-}
-
/** Terminate access to a mmalloc managed region by unmapping all memory pages associated with the region, and closing
* the file descriptor if it is one that we opened.
mdptemp->next_mdesc = mdp->next_mdesc;
- xbt_mheap_destroy_no_free(mdp);
struct mdesc mtemp = *mdp;
/* Now unmap all the pages associated with this region by asking for a
xbt_mheap_t mdp = NULL;
if ((mdp =__mmalloc_default_mdp)){
while(mdp){
- LOCK(mdp);
mdp = mdp->next_mdesc;
}
}
xbt_mheap_t mdp = NULL;
if ((mdp =__mmalloc_default_mdp)){
while(mdp){
- UNLOCK(mdp);
mdp = mdp->next_mdesc;
}
}
struct mdesc* mdp = NULL;
if ((mdp =__mmalloc_default_mdp)){
while(mdp){
- UNLOCK(mdp);
mdp = mdp->next_mdesc;
}
}