I think you should use a pointer to your data in your userdata in
this case.
Then you can free the large block of data (and null the pointer)
when the userdata is closed instead of freeing it when it is
collected.
--
Thomas
And what is preventing you from using the same alloc / free that Lua is using?
--
Thomas