msgpack: allow to pass 'struct ibuf *' into encode()
Before the patch msgpack Lua module provided a method encode() able to take a custom buffer to encode into. But it should be of type 'struct ibuf', what made it impossible to use buffer.IBUF_SHARED as a buffer, because its type is 'struct ibuf *'. Strangely, but FFI can't convert these types automatically. This commit allows to use 'struct ibuf *' as well, and moves this functionality into a function in utils.h. Now both msgpack and merger modules can use ibuf directly and by pointer.
Showing
- src/box/lua/merger.c 2 additions, 22 deletionssrc/box/lua/merger.c
- src/lua/msgpack.c 3 additions, 9 deletionssrc/lua/msgpack.c
- src/lua/utils.c 25 additions, 0 deletionssrc/lua/utils.c
- src/lua/utils.h 8 additions, 0 deletionssrc/lua/utils.h
- test/app/msgpack.result 25 additions, 1 deletiontest/app/msgpack.result
- test/app/msgpack.test.lua 9 additions, 0 deletionstest/app/msgpack.test.lua
Loading
Please register or sign in to comment