lua-users home
lua-l archive

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

On Fri, Jan 20, 2012 at 3:41 AM, Matthew Wild <> wrote:
> On 20 January 2012 02:03, Jay Carlson <> wrote:

>> I had an advantage: most of my tables were already being generated from tolua++ source. I didn't need to scan my own source code to find strings, and there already was a code generation step. What I thought I needed was rommable hash tables, some const structure which could live in the .text/.rodata section and be sharable (and a candidate for page-out) across all the apps loading the luafltk shared object.
>> My plan was to create my own user type with an __index which could look up methods by name in a (perhaps perfect) const hash table generated by tolua++. This C hash would not be visible to users; a regular writable Lua table would be hit first. At that point I could play around with memoizing the C-side hash results, weak tables etc.
> Similar idea to eLua's rotables:

Similar problem, similar solution. Hypothetically. eLua has the
distinct advantage of, you know, actually existing. I'd prefer the
weirdo tables not to be visible to users, only as fallbacks from
regular tables, but that's trivial. I don't know what can be done at
compile-time these days but I bet a non-C pass would help.

I like it when other people solve the problems I thought few others
had. I'll look at eLua now...