Thought on limiting scope of GC

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Feb 14 13:19:19 PST 2014


On 2/14/14, 8:26 AM, Jerry wrote:
> Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> writes:
>
>> On 2/14/14, 3:28 AM, Jerry wrote:
>>> Track says keep track of objects allocated after the track call, and
>>> cleanup only looks at those objects that were recently allocated,
>>> ignoring the rest of the heap.
>>>
>>> If you're saying that allocators will provide the means of doing this,
>>> then that's fine.
>>
>> I'm thinking of something like:
>>
>> MyAllocator alloc = ...;
>> alloc.installGlobally();
>> ...
>> alloc.deallocateAll();
>> alloc.uninstallGlobally();
>
> The difference is that I'd like the ability for some objects to live
> after the region ends.  I.e. it's reducing the scope of the GC, not
> temporarily replacing it with a completely separate heap.

Then I guess you'd need to use two allocators.

Andrei



More information about the Digitalmars-d mailing list