[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to make ROMable Lua data
- From: "Bogdan Marinescu" <bogdan.marinescu@...>
- Date: Mon, 12 Jan 2009 17:39:55 +0200
On Mon, Jan 12, 2009 at 5:23 PM, Juris Kalnins <email@example.com>
Thank you, it has many useful things. Especially link to the Lua test
suite. This patch actually does not put any native Lua objects into
the r/o space, right? What I want is to put there any normal Lua data
(closures, tables, strings, userdata ...), and to reference it from heap values.
It actually defines two new data types (rotable and lightfunction) which live ONLY in ROM. I considered something similar for strings at some point, but gave up the idea pretty quickly, as the semantics of this new type weren't completely clear to me.
But such "light" CFunctions and tables are very useful, too.
They also can be implemented by setting appropriate metatable for lightuserdata.
That way it requires no change to Lua at all.
Sorry, but I don't understand how setting a metatable for the lightuserdata type is equivalent to my patch.