[Tarantool-patches] [PATCH 27/43] build: export src/lua/buffer.c symbols

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Apr 12 03:13:08 MSK 2020


Exports functions used by src/lua/buffer.lua via FFI.

Part of #2971
---
 extra/exports    |  7 -------
 src/lua/buffer.c | 14 ++++++++++++++
 src/lua/init.c   |  4 ++++
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/extra/exports b/extra/exports
index cc7aa4f11..2d1d9f05e 100644
--- a/extra/exports
+++ b/extra/exports
@@ -2,13 +2,6 @@
 
 # FFI
 
-ibuf_create
-ibuf_reinit
-ibuf_destroy
-ibuf_reserve_slow
-
-lua_static_aligned_alloc
-
 swim_is_configured
 swim_cfg
 swim_set_payload
diff --git a/src/lua/buffer.c b/src/lua/buffer.c
index 5fd349261..0eb771e51 100644
--- a/src/lua/buffer.c
+++ b/src/lua/buffer.c
@@ -29,6 +29,7 @@
  * SUCH DAMAGE.
  */
 #include "small/static.h"
+#include "small/ibuf.h"
 
 /**
  * Static inline functions like in static.h can't be exported.
@@ -40,3 +41,16 @@ lua_static_aligned_alloc(size_t size, size_t alignment)
 {
 	return static_aligned_alloc(size, alignment);
 }
+
+void **
+tarantool_lua_buffer_export_syms(void)
+{
+	static void *syms[] = {
+		(void *)ibuf_create,
+		(void *)ibuf_reinit,
+		(void *)ibuf_destroy,
+		(void *)ibuf_reserve_slow,
+		(void *)lua_static_aligned_alloc,
+	};
+	return syms;
+}
diff --git a/src/lua/init.c b/src/lua/init.c
index 2a09b1355..65c1a04ec 100644
--- a/src/lua/init.c
+++ b/src/lua/init.c
@@ -731,6 +731,9 @@ tarantool_lua_free()
 #endif
 }
 
+void **
+tarantool_lua_buffer_export_syms(void);
+
 void **
 tarantool_lua_digest_export_syms(void);
 
@@ -751,6 +754,7 @@ tarantool_lua_export_syms(void)
 {
 	static void *syms[] = {
 		/* Submodules. */
+		(void *)tarantool_lua_buffer_export_syms,
 		(void *)tarantool_lua_digest_export_syms,
 		(void *)tarantool_lua_msgpack_export_syms,
 		(void *)tarantool_lua_socket_export_syms,
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list