[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: String parameters when calling C from Lua
- From: "Daniel Collins" <daniel.collins@...>
- Date: Fri, 19 May 2006 20:32:35 +0930
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