beforeGarbageCollection

Bane branimir.milosavljevic at gmail.com
Thu Jun 17 02:12:36 PDT 2010


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.
> 
> 
> Andrei

void beforeGarbageCollection(bool delegate() callMe);

Maybe return value indicating should collect cycle be executed or skipped only that once? There might be some cases that it can be useful. Just my 2c


More information about the Digitalmars-d mailing list