Greedy memory handling

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Wed Sep 11 04:14:23 PDT 2013


On 11/09/13 12:34, monarch_dodra wrote:
> 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"

How about GC.addRoot and GC.removeRoot ... ?


More information about the Digitalmars-d-learn mailing list