Example #1
0
extern "C" size_t MYCDECL CUSTOM_GETSIZE (void * ptr)
{
  TheCustomHeapType * theCustomHeap = getCustomHeap();
  if (ptr == NULL) {
    return 0;
  }
  return theCustomHeap->getSize(ptr);
}
Example #2
0
static void deleteThatHeap (void * p) {
  TheCustomHeapType * heap = (TheCustomHeapType *) p;
  heap->clear();
  getMainHoardHeap()->free ((void *) heap);
  
  // Relinquish the assigned heap.
  getMainHoardHeap()->releaseHeap();
}
Example #3
0
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();
}
Example #4
0
// 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();
}
Example #5
0
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;
}
Example #6
0
extern "C" void MYCDECL CUSTOM_FREE (void * ptr)
{
  TheCustomHeapType * theCustomHeap = getCustomHeap();
  theCustomHeap->free (ptr);
}
Example #7
0
static inline void * internalMalloc (size_t sz)
{
  TheCustomHeapType * theCustomHeap = getCustomHeap();
  void * ptr = theCustomHeap->malloc (sz);
  return ptr;
}
Example #8
0
 void * xxmalloc (size_t sz) {
   TheCustomHeapType * h = getCustomHeap();
   void * ptr = h->malloc (sz);
   return ptr;
 }
Example #9
0
extern "C" void * MYCDECL CUSTOM_MALLOC (size_t sz)
{
  TheCustomHeapType * theCustomHeap = getCustomHeap();
  void * ptr = theCustomHeap->malloc (sz);
  return ptr;
}