From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C84234696C3 for ; Thu, 23 Apr 2020 03:12:43 +0300 (MSK) From: Vladislav Shpilevoy Date: Thu, 23 Apr 2020 02:12:38 +0200 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 0/3] box_return_mp List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, korablev@tarantool.org, imun@tarantool.org The patchset extends the public C API with a function box_return_mp(). It allows to return arbitrary MessagePack from user's code. First patch introduces a new struct port - port_c. It replaces port_tuple for stored C functions, and is able to store both tuples and raw MessagePack. Second patch introduces the new public function. Third patch removes no longer needed struct port_tuple, since it appeared to be not faster than struct port_c. Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-4641-c-function-ret-mp Issue: https://github.com/tarantool/tarantool/issues/4641 Changes in v2: - Review fixes for comments from Nikita and Igor; - port_tuple is removed. Vladislav Shpilevoy (3): box: introduce port_c box: introduce box_return_mp() public C function box: replace port_tuple with port_c everywhere extra/exports | 1 + src/box/box.cc | 12 ++- src/box/box.h | 19 ++++ src/box/execute.c | 10 +- src/box/execute.h | 13 ++- src/box/func.c | 2 +- src/box/key_list.c | 4 +- src/box/lua/execute.c | 6 +- src/box/lua/misc.cc | 18 ++-- src/box/lua/schema.lua | 29 +++--- src/box/port.c | 201 +++++++++++++++++++++++++----------- src/box/port.h | 91 ++++++++-------- src/box/sql/func.c | 22 ++-- src/lib/core/port.h | 4 +- test/box/function1.c | 37 +++++++ test/box/function1.result | 33 ++++++ test/box/function1.test.lua | 16 +++ 17 files changed, 367 insertions(+), 151 deletions(-) -- 2.21.1 (Apple Git-122.3)