From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v1 1/1] box: rework tuple_init_field_map to allocate field_map
Date: Wed, 27 Feb 2019 11:35:10 +0300 [thread overview]
Message-ID: <20190227083510.px53hxvgttuljvny@esperanza> (raw)
In-Reply-To: <9583df5a4a7ba21d1d82b99b8e33dcdb460ac732.1550582431.git.kshcherbatov@tarantool.org>
On Tue, Feb 19, 2019 at 04:26:02PM +0300, Kirill Shcherbatov wrote:
> diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c
> index b26b367a1..445bc725c 100644
> --- a/src/box/tuple_format.c
> +++ b/src/box/tuple_format.c
> @@ -801,18 +801,22 @@ tuple_format1_can_store_format2_tuples(struct tuple_format *format1,
> }
>
> /** @sa declaration for details. */
> -int
> -tuple_init_field_map(struct tuple_format *format, uint32_t *field_map,
> - const char *tuple, bool validate)
> +uint32_t *
> +tuple_field_map_create(struct tuple_format *format, const char *tuple,
> + bool validate, uint32_t *field_map_size,
> + struct region *region)
Why pass the region explicitly? I don't see any point in this, at least
not in this particular patch. Please use fiber()->gc as before. Leaving
the region dirty on error is OK.
> {
> - if (tuple_format_field_count(format) == 0)
> - return 0; /* Nothing to initialize */
Let's please leave this check here - duplicating it at each call site
looks ugly. To do this, we'll have to return the field map in an out
argument. I think it's OK.
next prev parent reply other threads:[~2019-02-27 8:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 13:26 Kirill Shcherbatov
2019-02-27 8:35 ` Vladimir Davydov [this message]
2019-02-27 11:45 ` [tarantool-patches] " Kirill Shcherbatov
2019-02-28 9:45 ` Vladimir Davydov
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=20190227083510.px53hxvgttuljvny@esperanza \
--to=vdavydov.dev@gmail.com \
--cc=kshcherbatov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [PATCH v1 1/1] box: rework tuple_init_field_map to allocate field_map' \
/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