return __mmalloc_current_heap;
}
-void mmalloc_set_current_heap(xbt_mheap_t new_heap)
+xbt_mheap_t mmalloc_set_current_heap(xbt_mheap_t new_heap)
{
+ xbt_mheap_t heap = __mmalloc_current_heap;
__mmalloc_current_heap = new_heap;
+ return heap;
}
#ifdef MMALLOC_WANT_OVERRIDE_LEGACY
}
}
+void* malloc_no_memset(size_t n)
+{
+ if (!__malloc_use_mmalloc) {
+ return mm_real_malloc(n);
+ }
+
+ xbt_mheap_t mdp = GET_HEAP();
+ if (!mdp)
+ return NULL;
+
+ LOCK(mdp);
+ void *ret = mmalloc_no_memset(mdp, n);
+ UNLOCK(mdp);
+ return ret;
+}
+
void *malloc(size_t n)
{
if (!__malloc_use_mmalloc) {