lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Chris Marrin wrote:
But what resource could you possibly be getting rid of? Do you have some lightuserdatas in the table that have some data? If so, then you should make these full userdatas and attach __gc methods to them. I can't imagine a case where a table needs an __gc method?

Well, if you really want to know, I'm doing low level rapid development involving lots of memory manipulation. I don't have time to tweak userdata and then wait tens of minutes for the project to rebuild.

As such I've plugged malloc and free into Lua, along with the equivalents of peek and poke, in order to do the low level memory manipulation. I implement my interfaces in Lua using these primitives, meaning all I have to do to update the system is save the file.

One day, when the system is stable and fully featured, I might rewrite the interfaces to use userdata, but not any time soon.

--
Lisa
http://www.thecommune.org.uk/~lisa/