[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Garbage collection durint pcall.
- From: Sean Conner <sean@...>
- Date: Mon, 3 Jun 2019 21:28:48 -0400
It was thus said that the Great Andrew Gierth once stated:
> >>>>> "Roberto" == Roberto Ierusalimschy <roberto@inf.puc-rio.br> writes:
>
> >> An object reference may be abandoned as soon as the program gets to
> >> the point where it will no longer need the object for its normal
> >> execution (i.e. ignoring the effects of weak references and
> >> finalizers). The finalizer can run any time after that (1ns or 1
> >> year later).
>
> Roberto> +1.
>
> So if one needs to prevent an object's removal from a weak table during
> the execution of a block of code, how should it be done, if simply
> assigning the value to a local isn't enough?
Assigning it to a local is enough to keep it from being removed from a
weak table.
-spc