William Adams wrote: > I'm holding onto the cast within the table, along with the key, > which is the function name. Is that sufficient to keep the cast > around? Yes. The result of that cast is just a cdata object holding a function pointer. This object is anchored in a table, so it won't go away. You only have to take care not to unload the shared library that contains the code for this function. You need to keep a reference to the result of ffi.load(). Usually there are some Lua functions around that anchor it in an upvalue, so this is less of a concern. --Mike