extern "C" size_t MYCDECL CUSTOM_GETSIZE (void * ptr) { TheCustomHeapType * theCustomHeap = getCustomHeap(); if (ptr == NULL) { return 0; } return theCustomHeap->getSize(ptr); }
static void deleteThatHeap (void * p) { TheCustomHeapType * heap = (TheCustomHeapType *) p; heap->clear(); getMainHoardHeap()->free ((void *) heap); // Relinquish the assigned heap. getMainHoardHeap()->releaseHeap(); }
static void deleteThatHeap(void * p) { TheCustomHeapType * heap = reinterpret_cast<TheCustomHeapType *>(p); heap->clear(); getMainHoardHeap()->free(reinterpret_cast<void *>(heap)); // Relinquish the assigned heap. getMainHoardHeap()->releaseHeap(); }
// A special routine we call on thread exits to free up some resources. static void exitRoutine (void) { TheCustomHeapType * heap = getCustomHeap(); // Clear the TLAB's buffer. heap->clear(); // Relinquish the assigned heap. getMainHoardHeap()->releaseHeap(); }
void * xxmalloc (size_t sz) { TheCustomHeapType * h = getCustomHeap(); void * ptr = h->malloc (sz); #ifdef _DEBUG addallocsz(sz); printallocsz(sz); #endif //fprintf(stdout,"recording address \n"); //record_addr(ptr,sz); return ptr; }
extern "C" void MYCDECL CUSTOM_FREE (void * ptr) { TheCustomHeapType * theCustomHeap = getCustomHeap(); theCustomHeap->free (ptr); }
static inline void * internalMalloc (size_t sz) { TheCustomHeapType * theCustomHeap = getCustomHeap(); void * ptr = theCustomHeap->malloc (sz); return ptr; }
void * xxmalloc (size_t sz) { TheCustomHeapType * h = getCustomHeap(); void * ptr = h->malloc (sz); return ptr; }
extern "C" void * MYCDECL CUSTOM_MALLOC (size_t sz) { TheCustomHeapType * theCustomHeap = getCustomHeap(); void * ptr = theCustomHeap->malloc (sz); return ptr; }