From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (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 58F23469719 for ; Thu, 5 Mar 2020 23:46:08 +0300 (MSK) References: <20200305113600.65203-1-sergepetrenko@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Thu, 5 Mar 2020 21:46:06 +0100 MIME-Version: 1.0 In-Reply-To: <20200305113600.65203-1-sergepetrenko@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Serge Petrenko Cc: tarantool-patches@dev.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); } 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);