[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Light User Data
- From: Benoit Germain <bgermain@...>
- Date: Mon, 9 Sep 2002 09:31:54 +0200
This is the case: my lightuserdata/heavyurserdata pairs are kept in a table,
itself stored in the registry.
> -----Original Message-----
> From: Roberto Ierusalimschy [mailto:email@example.com]
> Sent: vendredi 6 septembre 2002 21:16
> To: Multiple recipients of list
> Subject: Re: Light User Data
> > 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
> the metatable.
> 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.
> -- Roberto