fiber_channel: add accessor to internal functions
The Rust module [1] leans on several internal symbols. They were open in Tarantool 2.8 (see #2971 and #5932), but never were in the public API. Tarantool 2.10.0 hides the symbols and we need a way to get them back to use in the module. We have the following options: 1. Design and expose a module API for fiber channels. 2. Export the symbols with a prefix like `tnt_internal_` (to don't spoil the global namespace). 3. Provide a `dlsym()` alike function to get an address of an internal symbol for users who knows what they're doing. I think that the third way offers the best compromise between amount of effort, quality of the result and opportunities to extend. In this commit I hardcoded the list of functions to make the change as safe as possible. Later I'll return here to autogenerate the list. Exported the following function from the tarantool executable: ```c void * tnt_internal_symbol(const char *name); ``` I don't add it into the module API headers, because the function is to perform a dark magic and we don't suggest it for users. While I'm here, added `static` to a couple of fiber channel functions, which are only used within the compilation unit. [1]: https://github.com/picodata/tarantool-module Part of #7228 Related to #6372 NO_DOC=don't advertize the dangerous API NO_CHANGELOG=don't advertize the dangerous API
Showing
- extra/exports 1 addition, 0 deletionsextra/exports
- src/CMakeLists.txt 5 additions, 2 deletionssrc/CMakeLists.txt
- src/lib/core/fiber_channel.c 2 additions, 2 deletionssrc/lib/core/fiber_channel.c
- src/symbols.c 85 additions, 0 deletionssrc/symbols.c
- test/app-luatest/tnt_internal_symbol_test.lua 40 additions, 0 deletionstest/app-luatest/tnt_internal_symbol_test.lua
Loading
Please register or sign in to comment