lua-users home
lua-l archive

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

>can the luaC function interfaces be configured with const data
>> structures instead of having to be constructed at startup in ram
>> structures?

>>If you mean lundump.c, then this has been on my wish list for as long as
>>I can remember. I think it can be done without much effort for bytecode
>>and line information: one only needs to add a flag somewhere to make
>>the garbage collector ignore those parts. Strings are a different problem
>>because Lua stores them internally in a block that contains other data
>>before the string data. So, strings would have to be copied. I'm not sure
>>whether this partial solution would give the savings you're after.

>>Another possibility is to rewrite the precompiled format to be closer to
>>the internal structs. This may work for better savings but the string
>>problem will remain unless the format includes header data for strings.

>>Bottom line: it can probably be done without too much work but it's not
>>something that can be simply "configured".

I was leaning to the following approach and would like to know if it is

I was considering setting up an embedded table environment in C.  The
strings and functon pointer mappings would be in const data structures. 
Some sort of meta table mapping would allow something like this

var.method( .. parameters )  -- to map to a C gateway function that would
run the embedded C code and return data to lua.  A const C data structure
would map var, method and C function pointer together.

Not sure if the lua meta table facitlities have the capability to do this.

Glenn Edgar


mail2web - Check your email from the web at .