Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v3 4/6] box: export registered functions in box.func folder
Date: Tue, 18 Jun 2019 17:06:23 +0300	[thread overview]
Message-ID: <20190618140623.z6lzqqquq4ebwg3m@esperanza> (raw)
In-Reply-To: <81d7293c993369d7d4e984391c8854bdf5b16818.1560433806.git.kshcherbatov@tarantool.org>

On Thu, Jun 13, 2019 at 05:08:24PM +0300, Kirill Shcherbatov wrote:
> diff --git a/src/box/func.h b/src/box/func.h
> index 1271bde67..f7081eccd 100644
> --- a/src/box/func.h
> +++ b/src/box/func.h
> @@ -419,23 +418,20 @@ encode_lua_call_16(lua_State *L)
>  	 *
>  	 * TODO: forbid explicit yield from __serialize or __index here
>  	 */
> -	struct mpstream stream;
> -	mpstream_init(&stream, port->out, obuf_reserve_cb, obuf_alloc_cb,
> -		      luamp_error, port->L);
> -
>  	struct luaL_serializer *cfg = luaL_msgpack_default;
> -	port->size = luamp_encode_call_16(port->L, cfg, &stream);
> -	mpstream_flush(&stream);
> +	port->size = luamp_encode_call_16(port->L, cfg, port->stream);
> +	mpstream_flush(port->stream);
>  	return 0;
>  }
>  
>  static inline int
> -port_lua_do_dump(struct port *base, struct obuf *out, lua_CFunction handler)
> +port_lua_do_dump(struct port *base, struct mpstream *stream,
> +		 lua_CFunction handler)
>  {
> -	struct port_lua *port = (struct port_lua *)base;
> +	struct port_lua *port = (struct port_lua *) base;
>  	assert(port->vtab == &port_lua_vtab);
>  	/* Use port to pass arguments to encoder quickly. */
> -	port->out = out;
> +	port->stream = stream;

Why does mpstream (or obuf) have to be a member of port_lua? Just to
pass it to encode_lua_call? If so, let's please introduce an auxiliary
struct that would store port and mpstream while we are at it.

Other than that, the patch is good.

  reply	other threads:[~2019-06-18 14:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 14:08 [PATCH v3 0/6] box: rework functions machinery Kirill Shcherbatov
2019-06-13 14:08 ` [PATCH v3 1/6] box: rework func cache update machinery Kirill Shcherbatov
2019-06-18 10:52   ` Vladimir Davydov
2019-06-19 15:51     ` [tarantool-patches] " Kirill Shcherbatov
2019-06-13 14:08 ` [PATCH v3 2/6] box: rework box_lua_{call, eval} to use input port Kirill Shcherbatov
2019-06-17  9:35   ` [tarantool-patches] " Konstantin Osipov
2019-06-17 10:27     ` [tarantool-patches] " Kirill Shcherbatov
2019-06-18 12:12   ` Vladimir Davydov
2019-06-19 15:51     ` [tarantool-patches] " Kirill Shcherbatov
2019-06-19 16:11       ` Vladimir Davydov
2019-06-18 13:58   ` Vladimir Davydov
2019-06-19 18:28   ` [tarantool-patches] " Konstantin Osipov
2019-06-20  7:53     ` Kirill Shcherbatov
2019-06-20  8:09       ` Konstantin Osipov
2019-06-20  8:44         ` [tarantool-patches] " Kirill Shcherbatov
2019-06-19 18:30   ` [tarantool-patches] " Konstantin Osipov
2019-06-13 14:08 ` [PATCH v3 3/6] box: rework func object as a function frontend Kirill Shcherbatov
2019-06-18 13:23   ` Vladimir Davydov
2019-06-19 15:51     ` [tarantool-patches] " Kirill Shcherbatov
2019-06-13 14:08 ` [PATCH v3 4/6] box: export registered functions in box.func folder Kirill Shcherbatov
2019-06-18 14:06   ` Vladimir Davydov [this message]
2019-06-19 15:51     ` [tarantool-patches] " Kirill Shcherbatov
2019-06-18 16:11   ` Vladimir Davydov
2019-06-13 14:08 ` [PATCH v3 5/6] box: refactor box_lua_find helper Kirill Shcherbatov
2019-06-18 14:22   ` Vladimir Davydov
2019-06-19 15:51     ` [tarantool-patches] " Kirill Shcherbatov
2019-06-13 14:08 ` [PATCH v3 6/6] box: introduce Lua persistent functions Kirill Shcherbatov
2019-06-18 16:23   ` Vladimir Davydov
2019-06-19 15:51     ` [tarantool-patches] " Kirill Shcherbatov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190618140623.z6lzqqquq4ebwg3m@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH v3 4/6] box: export registered functions in box.func folder' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox