Greedy memory handling

monarch_dodra monarchdodra at gmail.com
Wed Sep 11 03:34:28 PDT 2013


On Wednesday, 11 September 2013 at 10:28:37 UTC, Gary Willoughby 
wrote:
> You can then let the GC handle it or free it yourself with 
> GC.free(*buffer).

But if the buffer is stored in a static variable, the GC will 
never collect it. I *could* also free it myself, but why/when 
would I do that?

Did you just just let your buffer grow, and never let it get 
collected?

Is there a way to do something like "I'm using this buffer, but 
if you want to collect it, then go ahead. I'll reallocate a new 
one *if/when* I need it again"


More information about the Digitalmars-d-learn mailing list