beforeGarbageCollection

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jun 17 09:17:44 PDT 2010


Walter Bright wrote:
> Andrei Alexandrescu wrote:
>> I'm thinking of a feature that would improve the memory footprint of D 
>> programs. Say druntime provided a function:
>>
>> void beforeGarbageCollection(void delegate() callMe);
>>
>> The runtime would guarantee that callMe gets called before any 
>> collection. That would allow modules to clean up caches (e.g. free 
>> lists) to improve their memory profile.
>>
>> Any thoughts, please share.
> 
> Thread local or thread global?

Good question! I think it's thread-local because the whole point is to 
clear thread-local caches.

The function could be called during execution of new within a thread.


Andrei


More information about the Digitalmars-d mailing list