You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be good to have some function like realloc() that tries to expand/shrink allocated memory buffer but doesn't try to relocate the block, just returns unsuccessful status when in place reallocation is impossible.
The idea is explained in detail here (it's a proposal for ISO C++).
As examples of a possible solution:
jemalloc has xmallocx() function with the required behaviour (also it returns the real size of the resulting resized allocation as requested in #2).
Windows HeapReAlloc() function has HEAP_REALLOC_IN_PLACE_ONLY flag.
The text was updated successfully, but these errors were encountered:
Ah I see what you mean. However, the current design often does have more space available. But at the same time, the design is based on size segregated areas so it does not support further in-place expanding of blocks (well, perhaps we could support it for huge objects).
Hello!
It would be good to have some function like
realloc()
that tries to expand/shrink allocated memory buffer but doesn't try to relocate the block, just returns unsuccessful status when in place reallocation is impossible.The idea is explained in detail here (it's a proposal for ISO C++).
As examples of a possible solution:
jemalloc has
xmallocx()
function with the required behaviour (also it returns the real size of the resulting resized allocation as requested in #2).Windows HeapReAlloc() function has
HEAP_REALLOC_IN_PLACE_ONLY
flag.The text was updated successfully, but these errors were encountered: