Home » Community » U++ community news and announcements » GetMemoryBlockSize, TryRealloc
GetMemoryBlockSize, TryRealloc [message #44212] |
Mon, 26 January 2015 20:25 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Heap API is now enhanced by two new functions:
size_t GetMemoryBlockSize(void *ptr);
- returns the 'real' writable size for any block. Note that in debug mode, this is equal to required size during MemoryAlloc (because of block debug info), but might be bigger than that in release mode.
bool TryRealloc(void *ptr, size_t newsize);
- attempts to increase the size of block. This only can be successful in release mode (in debug, always returns false). For very large and small blocks, this can succeed only if the real size of block is larger than requested one, but for medium blocks (~2KB-50KB) this can actually use next adjacent memory block if it is free...
|
|
|
Goto Forum:
Current Time: Fri Apr 19 11:02:17 CEST 2024
Total time taken to generate the page: 0.05459 seconds
|