[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Metatable check helper API proposal
- From: Gé Weijers <ge@...>
- Date: Wed, 19 Aug 2020 07:31:18 -0700
On Wed, Aug 19, 2020 at 7:20 AM Sergey Zakharchenko
> Right; that's why I abandoned that in favor of C pointer comparisons.
> Library init code could create a metatable, ref it so that it doesn't
> go away, call lua_topointer on it and store the pointer in a C
> variable, then use it for comparison inside the C metamethod.
If this C variable is a static or global variable your code is no
longer reentrant, so you could not use the library with two Lua states
in your code. This may not be an issue for you, but the technique is
not universally applicable.