|
On Dec 17, 2013, at 2:08 AM, Sir Pogsalot <sir.pogsalot@gmail.com> wrote: You probably already know this, but weak tables only work for garbage collected reference types with explicit constructions[1], e.g. tables and userdata, but not numbers, booleans, strings, and light C functions. Only “by reference” types are collected, which includes tables, full userdata and threads. In fact, it’s the fact that these items are multi-reference that makes them subject to GC semantics. Things like booleans, numbers etc are not collected because there lifetimes are explicit. Strings are a special case because, although they are by-reference, they are interned which means they act like values. —Tim |