On 9/3/12 7:30 AM, Joshua Day wrote:
How would you do garbage collection then? The garbage collector is not visiting any FFI objects.Justin Cormack wrote:As Mike said you need a type name (string) a ctype or an object of the type. So a Lua table can store either of these. An ffi object can only store the third. But it has to be allocated. You could create a C struct with a single field of the right type (not an array) and pass this to create the array if you want to avoid Lua tables.For what it's worth, this is why I suggested letting ffi objects hold proper Lua references. William could then keep a reference to the ctype. Nice and straightforward. -- Joshua