std.allocator suggestions

Artem Tarasov lomereiter at gmail.com
Fri Nov 29 05:10:44 PST 2013


1. Allocator which preallocates a fixed amount of extra bytes for each
chunk, so that reallocations within that limit are guaranteed to be
in-place. Multiple reallocations should be supported, too, e.g. if the
limit is 10 it allocates 210 bytes when 200 are requested and then reallocs
200 -> 205 -> 203 -> 210 are all in-place.

2. Allocator similar to Region that counts numbers of
allocations/deallocations, and once the difference reaches zero, reuses the
buffer instead of returning null.

3. Same as above but instead calls deallocate when difference reaches zero.
This would allow to use regions allocated by malloc with cascading
allocator.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131129/261e78fc/attachment.html>


More information about the Digitalmars-d mailing list