[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature request: more integration of Lua and C memory management
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 09 Jun 2004 15:12:42 -0300
> I don't think any scheme with weak tables will work correctly, and it
> would be too slow anyway
Why? (for both statements...)
> That array should be accessible given only a pointer to the userdata,
> and not the actual Lua object (e.g. by storing the array immediately
> before the userdata and counting backwards).
The idea of userdata keeping direct references to other Lua objects
is nice. The original Smalltalk had something quite similar: Objects
could have an optional "raw" area plus an "array" area. But to make them
accessible given only a pointer seem dirty and dangerous. (Among other
things, how to avoid the userdata being collected?)
-- Roberto