[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: lua_newuserdatabox (4.1)
- From: "Curt Carpenter" <curtc@...>
- Date: Thu, 21 Feb 2002 09:25:31 -0800
> The old lua_pushuserdata also did memory allocation, when the pointer
was not already "inside" Lua. But, if you know that the pointer is
already inside Lua, usually you do not need to use lua_newuserdatabox,
but can use lua_pushvalue (or something similar). Those operations do
not do memory allocation.
This is all way too heavy weight. I just need to pass a pointer from C
and be able to get it back in C, with no more processing on it by Lua
than a simple number. These pointers point to things whose lifetimes
aren't controlled by anything in Lua anyway, so the argument about
refcount safety is irrelevant.