Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Improved heap diagnostics
|
|
Re: Improved heap diagnostics [message #14824 is a reply to message #14823] |
Sun, 16 March 2008 19:14 ![Go to previous message Go to previous message](theme/default/images/up.png) ![Go to next message Go to next message](theme/default/images/down.png) |
![](https://www.ultimatepp.org/forums/images/custom_avatars/3.png) |
mirek
Messages: 14000 Registered: November 2005
|
Ultimate Member |
|
|
Like this:
void *SysAllocRaw(size_t size)
{
LTIMING("SysAllocRaw");
if(sPeak) *sPeak = MemoryProfile();
sKB += int(((size + 4095) & ~4095) >> 10);
#ifdef PLATFORM_WIN32
void *ptr = VirtualAlloc(NULL, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
#else
#ifdef PLATFORM_LINUX
void *ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
#else
void *ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
#endif
#endif
if(!ptr)
Panic("Out of memory!");
return ptr;
}
?
Mirek
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Jul 27 14:25:25 CEST 2024
Total time taken to generate the page: 0.02213 seconds
|