From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (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 A04FD469719 for ; Fri, 6 Mar 2020 11:58:06 +0300 (MSK) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) From: Serge Petrenko In-Reply-To: Date: Fri, 6 Mar 2020 11:58:05 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20200305113600.65203-1-sergepetrenko@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] vclock: refactor vclock map to use type uint32_t List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the review! > 5 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2020 =D0=B3., =D0=B2 23:46, Vladislav = Shpilevoy =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0= =D0=BB(=D0=B0): >=20 > Hi! Thanks for the patch! >=20 > Consider this diff: >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 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 =3D buf; - int filter_size =3D __builtin_popcount(id_filter); + int filter_size =3D bit_count_u32(id_filter); data =3D mp_encode_map(data, filter_size !=3D 0 ? 6 : 5); data =3D mp_encode_uint(data, IPROTO_CLUSTER_UUID); data =3D xrow_encode_uuid(data, replicaset_uuid); >=20 > static inline int64_t > @@ -281,7 +281,7 @@ vclock_compare_generic(const struct vclock *a, = const struct vclock *b, > bool ignore_zero) > { > bool le =3D true, ge =3D true; > - unsigned int map =3D a->map | b->map; > + uint32_t map =3D a->map | b->map; > struct bit_iterator it; > bit_iterator_init(&it, &map, sizeof(map), true); >=20 That=E2=80=99s a shame I missed it. Fixed. The changes are on the branch -- Serge Petrenko sergepetrenko@tarantool.org