[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Nil-ing userdata
- From: David Pirrò <david.pirro@...>
- Date: Sat, 23 Oct 2010 14:48:11 +0200
Now I got it.
Thank you for clarification.
Il giorno 23/ott/2010, alle ore 14.33, Drake Wilson ha scritto:
> Quoth David Pirrò <email@example.com>, on 2010-10-23 14:22:27 +0200:
>> Is there a possibility to "force" the garbage collection?
> No. Why do you need to do this? Overwrite the contents of the
> userdata with a recognizable invalid state, then make further
> operations on it fail (and any finalizer do nothing instead). If you
> have a giant piece of memory that you need to free immediately or
> something, make the userdata only contain a pointer there, and then
> free the memory yourself in the dispose operation.
> Think about what you're describing: you're asking for every reference
> from anywhere in the heap to suddenly become something else. It's not
> impossible to design a GC scheme that allows this, but it tends to be
> either very expensive (scanning the entire heap) or pretty complicated
> and not as useful as you think (using forwarding pointers).
> ---> Drake Wilson