[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Integration of a new library in the Lua interpreter
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 10 Jul 2002 11:01:23 -0300
> For the sake of simplicity, since my library will be alone (beside the
> standard libraries), I have put the two tags in global variables.
Another option is to put them in the Lua registry. It is simple, and do
not have the problems of global variables (but may be a little slower).
> Once this userdata is pushed on the stack, what does it do there?
It stays there ;-) (But it is not "this" userdata; see below.)
> Do I have to pop it out?
> How this affects actually the real userdata? I am lost.
This trick is not simple, and even not completely correct. (That is why
we changed this whole stuff in 5.0.) When you "push" the userdata, it
coalesces with the userdata that already exists in Lua, so it is the
latter than ends up in the stack.