[Tarantool-patches] [PATCH] vclock: refactor vclock map to use type uint32_t

Serge Petrenko sergepetrenko at tarantool.org
Thu Mar 5 14:36:00 MSK 2020


We're using an unsigned int to hold vclock map, but there is no
guarantee that unsigned int will be 4 bytes in size to fit all the 32
vclock components. So use uint32_t instead.
---
No issue, discussed in scope of
https://github.com/tarantool/tarantool/issues/4739
Branch: https://github.com/tarantool/tarantool/tree/sp/vclock-map-refactor

 src/box/vclock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/box/vclock.h b/src/box/vclock.h
index eb0fb5d8b..9b499513a 100644
--- a/src/box/vclock.h
+++ b/src/box/vclock.h
@@ -82,7 +82,7 @@ enum {
 /** Cluster vector clock */
 struct vclock {
 	/** Map of used components in lsn array */
-	unsigned int map;
+	uint32_t map;
 	/** Sum of all components of vclock. */
 	int64_t signature;
 	int64_t lsn[VCLOCK_MAX];
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list