The primary reason I considered Lua/Gideros for my app was multiplatform capability and plugins. In my system, I get data from another WiFi object via LuaSockets (500KB) and I need to process the data. Processing the data has very complex math behind so I have developed a Ansi-C library for this already. Now I need to send this 500Kb data to my Ansi-C API.
Doing this in the stack would not work due to the large size of the data. In C, what I would do is simply pass two pointers to the function where the first pointer would point to raw data and second pointer is the output of the API, once the API returned, I would look at the results in the second pointer. This is not possible with Lua using pointers, now I am looking for a clean way to pass data back and forth between C and Gideros. What is the best approach? I do not want to use files for this purpose.
Comments
I think you have 3 options:
1. Use Lua arrays (tables) to pass/get the data.
2. Use Lua strings to pass/get data. Because Lua strings can hold any arbitrary binary data including zeros.
3. Develop a simple container as a plugin similar to JavaScript typed arrays and use your own container to pass/get data.