
On 10 Jun 2009, at 15:21, Ion GaztaƱaga wrote:
Christopher Jefferson wrote:
Out of interest, which set of extensions did you add to DLmalloc? Would be nice to try to come up with a small, consistant working set, to then try to sell to some mallocs.
See http://www.drivehq.com/web/igaztanaga/allocplus/#NewFunctionsForExpansion
Code is here:
Thanks! No offence, but while that method is good as it is as general as possible, it perhaps doesn't look very "C-like", and is maybe too complex to try to pursade them to add. How important is backward expansion, and try_shrink_in_place? While obviously these things are useful, do you think they are "vital"? I'm interested as you have clearly written a lot of code which uses these mechanisms. My thought is that adding a function which is exactly "realloc, except don't move, just return", with the option to try to get as much memory as possible, say: int realloc_try(void* ptr, size_t size, size_t* new_size) With the same semantics as relloc except it doesn't move, and if it can do a partial expansion (or shrink) tries to do as much as it can and returns the new size in new_size, is (from looking at source) a very easy addition to many mallocs, and less invasive. Chris