Den 28-09-2017 kl. 21:35 skrev Ion GaztaƱaga via Boost:
On 28/09/2017 10:49, Thorsten Ottosen via Boost wrote:
Reading through the argument, there are a few things I don't get. Is seems that the proof sort of assumes one container instance. And will the heap manager actually coalesce anything?
DLMalloc coalesces. Several heap managers coalesce when the allocation is bigger than a limit. Boost.Interprocess allocators coalesce.
I'm not sure what jemalloc and similar allocators do.
Yes, there seem to be many takes on this. Stuff like http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3536.html seem to suggest that a larger chunk is independent of smaller chunks. The argument says we are looking for \sum_{j=o}^{i-1} S[j] >= S[i+1] so the coalescing is supposed to happen between the i'th and (i+1)'th allocation. Now, if there are two vectors in play, or other data structures that uses memory, surely those leftovers can be coalesced into something that satisfy a larger growth factor. kind regards -Thorsten