Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] vclock: refactor vclock map to use type uint32_t
Date: Fri, 6 Mar 2020 11:58:05 +0300	[thread overview]
Message-ID: <C1725E50-E5BF-4AB3-8581-0D85C16B7A70@tarantool.org> (raw)
In-Reply-To: <f2f5ec85-8519-655e-0726-11dcd84159b4@tarantool.org>

Hi! Thanks for the review!

> 5 марта 2020 г., в 23:46, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> написал(а):
> 
> Hi! Thanks for  the patch!
> 
> Consider this diff:
> 
> ====================
> diff --git a/src/box/vclock.h b/src/box/vclock.h
> index 9b499513a..a8549d2a9 100644
> --- a/src/box/vclock.h
> +++ b/src/box/vclock.h
> @@ -195,7 +195,7 @@ vclock_copy(struct vclock *dst, const struct vclock *src)
> static inline uint32_t
> vclock_size(const struct vclock *vclock)
> {
> -	return __builtin_popcount(vclock->map);
> +	return bit_count_u32(vclock->map);
> }

Ok. Also fixed for replica id filter size in a separate commit.

diff --git a/src/box/xrow.c b/src/box/xrow.c
index 602049004..5e3cb0709 100644
--- a/src/box/xrow.c
+++ b/src/box/xrow.c
@@ -1205,7 +1205,7 @@ xrow_encode_subscribe(struct xrow_header *row,
                return -1;
        }
        char *data = buf;
-       int filter_size = __builtin_popcount(id_filter);
+       int filter_size = bit_count_u32(id_filter);
        data = mp_encode_map(data, filter_size != 0 ? 6 : 5);
        data = mp_encode_uint(data, IPROTO_CLUSTER_UUID);
        data = xrow_encode_uuid(data, replicaset_uuid);


> 
> static inline int64_t
> @@ -281,7 +281,7 @@ vclock_compare_generic(const struct vclock *a, const struct vclock *b,
> 		       bool ignore_zero)
> {
> 	bool le = true, ge = true;
> -	unsigned int map = a->map | b->map;
> +	uint32_t map = a->map | b->map;
> 	struct bit_iterator it;
> 	bit_iterator_init(&it, &map, sizeof(map), true);
> 

That’s a shame I missed it. Fixed. The changes are on the branch

--
Serge Petrenko
sergepetrenko@tarantool.org

  reply	other threads:[~2020-03-06  8:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05 11:36 Serge Petrenko
2020-03-05 20:46 ` Vladislav Shpilevoy
2020-03-06  8:58   ` Serge Petrenko [this message]
2020-03-08 22:16     ` Vladislav Shpilevoy
2020-03-10 11:23       ` Serge Petrenko
2020-03-16 20:31 ` Konstantin Osipov
2020-03-19 14:36   ` Serge Petrenko
2020-03-19 14:47     ` Konstantin Osipov
2020-03-20 11:15 ` Kirill Yukhin

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=C1725E50-E5BF-4AB3-8581-0D85C16B7A70@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] vclock: refactor vclock map to use type uint32_t' \
    /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