lua-users home
lua-l archive

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


Actually thinking about this more (with much help from Mike and Luiz) I
realise that my particular needs rule out keeping the string in lua.

The strings are immutable but need to persist in C longer than the
duration of the API function called from Lua. So the string parameter
passed in my method one would need to be copied into another buffer.

Whereas with method two, keeping the arrays in a C array outside of lua
then passing integers will avoid the string allocation and copy in my C
code. And the double to int conversion wont even occur since lua_number
is already set to int in my project.

Thanks for the help!

- DC