Skip to content

Refactor stash

Alexey Protsenko requested to merge refactor-stash into master

As we recently discovered, Tarantool has a peculiarity - when calling stored procedures with {language = "C"} option, it disregards the shared object (.so / .dylib) already loaded by Lua and makes the second independent dlopen. As a result, Lua and C stored procedures can't share state, because even static variables point to different memory locations.

As a workaround, this patch provides the API for hiding the state inside lua_State. Under the hood, the stash consumes a custom struct and leaks the wrapping box. Inside Lua, it's represented by a userdata, which the access() function provides access to.

Merge request reports