git-svn-id: svn://ultimatepp.org/upp/trunk@9789 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2016-05-03 21:41:39 +00:00
commit 8b9c1a6422
5 changed files with 72 additions and 40 deletions

View file

@ -10,8 +10,6 @@ NAMESPACE_UPP
#include "HeapImp.h"
static MemoryProfile *sPeak;
void *MemoryAllocPermanentRaw(size_t size)
{
if(size >= 256)
@ -34,21 +32,6 @@ void *MemoryAllocPermanent(size_t size)
return MemoryAllocPermanentRaw(size);
}
MemoryProfile *PeakMemoryProfile()
{
if(sPeak)
return sPeak;
sPeak = (MemoryProfile *)MemoryAllocPermanent(sizeof(MemoryProfile));
memset(sPeak, 0, sizeof(MemoryProfile));
return NULL;
}
void DoPeakProfile()
{
if(sPeak)
heap->Make(*sPeak);
}
void OutOfMemoryPanic(size_t size)
{
char h[200];
@ -68,6 +51,8 @@ void MemoryLimitKb(int kb)
sKBLimit = kb;
}
void DoPeakProfile();
void *SysAllocRaw(size_t size, size_t reqsize)
{
size_t rsz = int(((size + 4095) & ~4095) >> 10);
@ -299,11 +284,6 @@ void Heap::Make(MemoryProfile& f)
}
}
MemoryProfile::MemoryProfile()
{
heap->Make(*this);
}
#ifdef flagHEAPSTAT
int stat[65536];
int bigstat;