U++ framework
Do not panic. Ask here before giving up.

Home » Community » U++ community news and announcements » GetMemoryBlockSize, TryRealloc
GetMemoryBlockSize, TryRealloc [message #44212] Mon, 26 January 2015 20:25
mirek is currently offline  mirek
Messages: 14291
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...
Previous Topic: New builders features
Next Topic: LineEdit/CodeEditor heavily optimized for huge files
Goto Forum:
  


Current Time: Tue Sep 01 06:17:48 GMT+2 2026

Total time taken to generate the page: 0.00545 seconds