[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Light User Data
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 06 Sep 2002 16:16:20 -0300
> If you want to allow the heavy userdatas to be garbage
> collected, you could just give your registry a metatable
> with weakmode="v".
Please notice that we changed (back) the way you make a table weak: you
should use «setmode(t, "v")» (or lua_setmode, in C), instead of using
Also notice that it is not "polite" to change the weak mode of the
registry, as that table is shared by several libraries. Instead, you
should create a separate table (which can be stored in a registry field)
and set its mode to weak.