[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Weak keyed tables with primitive keys
- From: Gary Bringhurst <garyb@...>
- Date: Tue, 20 Oct 2009 12:48:04 -0600
Thanks Peter. That makes sense to me.
On Oct 20, 2009, at 10:16 AM, Peter Cawley wrote:
I believe that the following two excerpts from the the Lua 5.1
reference manual mean that strings, booleans, and numbers are always
strongly referenced, even in situations where other types would be
weak referenced (as in weak tables).
2.10.2 - "In other words, if the only references to an object are weak
references, then the garbage collector will collect this object."
2.2(.0) - "Tables, functions, threads, and (full) userdata values
On Tue, Oct 20, 2009 at 4:04 PM, Gary Bringhurst <email@example.com>
My google fu is failing me on this one.
Where can I find a definitive discussion of weak keyed tables and the
behavior of primitive data types as those weak keys? My tests say
unique string keys are never collected, and while I can see a
for that I'd really like to know the relationship of primitive
types such as
strings to the garbage collector. Do we have to use tables or user
keys in weak keyed tables in order for them to be collected?
Many thanks in advance,