mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
Heap fix
git-svn-id: svn://ultimatepp.org/upp/trunk@9789 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
35dbab0426
commit
8b9c1a6422
5 changed files with 72 additions and 40 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue