MMHeap.cpp revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
286N/A * available from http://www.virtualbox.org. This file is free software;
286N/A#include "MMInternal.h"
286N/A STAMR3Register(pVM, &pStat->cAllocations, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, "/MM/R3Heap/cAllocations", STAMUNIT_CALLS, "Number or MMR3HeapAlloc() calls.");
286N/A STAMR3Register(pVM, &pStat->cReallocations, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, "/MM/R3Heap/cReallocations", STAMUNIT_CALLS, "Number of MMR3HeapRealloc() calls.");
286N/A STAMR3Register(pVM, &pStat->cFrees, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, "/MM/R3Heap/cFrees", STAMUNIT_CALLS, "Number of MMR3HeapFree() calls.");
286N/A STAMR3Register(pVM, &pStat->cFailures, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, "/MM/R3Heap/cFailures", STAMUNIT_COUNT, "Number of failures.");
286N/A STAMR3Register(pVM, &pStat->cbCurAllocated, sizeof(pStat->cbCurAllocated) == sizeof(uint32_t) ? STAMTYPE_U32 : STAMTYPE_U64,
286N/A STAMVISIBILITY_ALWAYS, "/MM/R3Heap/cbCurAllocated", STAMUNIT_BYTES, "Number of bytes currently allocated.");
286N/A STAMR3Register(pVM, &pStat->cbAllocated, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, "/MM/R3Heap/cbAllocated", STAMUNIT_BYTES, "Total number of bytes allocated.");
286N/A STAMR3Register(pVM, &pStat->cbFreed, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, "/MM/R3Heap/cbFreed", STAMUNIT_BYTES, "Total number of bytes freed.");
286N/A return VINF_SUCCESS;
286N/A return VERR_NO_MEMORY;
return NULL;
return rc;
if (pv)
return VINF_SUCCESS;
return VERR_NO_MEMORY;
return NULL;
return rc;
if (pv)
return VINF_SUCCESS;
return VERR_NO_MEMORY;
#ifdef MMR3HEAP_WITH_STATISTICS
if (pStat)
if (!pStat)
return NULL;
STAMR3Register(pVM, &pStat->cAllocations, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, szName, STAMUNIT_CALLS, "Number or MMR3HeapAlloc() calls.");
STAMR3Register(pVM, &pStat->cReallocations, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, szName, STAMUNIT_CALLS, "Number of MMR3HeapRealloc() calls.");
STAMR3Register(pVM, &pStat->cFrees, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, szName, STAMUNIT_CALLS, "Number of MMR3HeapFree() calls.");
STAMR3Register(pVM, &pStat->cFailures, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, szName, STAMUNIT_COUNT, "Number of failures.");
STAMR3Register(pVM, &pStat->cbCurAllocated, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, szName, STAMUNIT_BYTES, "Number of bytes currently allocated.");
STAMR3Register(pVM, &pStat->cbAllocated, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, szName, STAMUNIT_BYTES, "Total number of bytes allocated.");
STAMR3Register(pVM, &pStat->cbFreed, STAMTYPE_U64, STAMVISIBILITY_ALWAYS, szName, STAMUNIT_BYTES, "Total number of bytes freed.");
if (cbSize == 0)
#ifdef MMR3HEAP_WITH_STATISTICS
return NULL;
if (!pHdr)
#ifdef MMR3HEAP_WITH_STATISTICS
return NULL;
#ifdef MMR3HEAP_WITH_STATISTICS
#ifdef MMR3HEAP_WITH_STATISTICS
if (!pv)
return NULL;
if (!cbNewSize)
return NULL;
return NULL;
#ifdef MMR3HEAP_WITH_STATISTICS
if (!pHdrNew)
#ifdef MMR3HEAP_WITH_STATISTICS
return NULL;
#ifdef MMR3HEAP_WITH_STATISTICS
if (!psz)
return NULL;
if (pszDup)
return pszDup;
if (!pv)
#ifdef MMR3HEAP_WITH_STATISTICS
switch (enmTag)
return sz;