From 49783133bc995aaac29e30fe54520fa2375a77d1 Mon Sep 17 00:00:00 2001 From: Muhammed Fatih BALIN Date: Tue, 6 Aug 2024 09:23:53 -0400 Subject: [PATCH] [GraphBolt] Better naming for split key variable. (#7659) --- graphbolt/src/cache_policy.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/graphbolt/src/cache_policy.h b/graphbolt/src/cache_policy.h index 15060cbb92..6baa2ddf06 100644 --- a/graphbolt/src/cache_policy.h +++ b/graphbolt/src/cache_policy.h @@ -35,7 +35,8 @@ namespace storage { struct CacheKey { auto getKey() const { - return (static_cast(key_upper_) << 32) + key_lower_; + return (static_cast(key_higher_16_bits_) << 32) + + key_lower_32_bits_; } CacheKey(int64_t key) : CacheKey(key, std::numeric_limits::min()) {} @@ -44,8 +45,8 @@ struct CacheKey { : freq_(0), // EndUse() should be called to reset the reference count. reference_count_(-1), - key_upper_(key >> 32), - key_lower_(key), + key_higher_16_bits_(key >> 32), + key_lower_32_bits_(key), position_in_cache_(position) { TORCH_CHECK(key == getKey()); static_assert(sizeof(CacheKey) == 2 * sizeof(int64_t)); @@ -134,8 +135,8 @@ struct CacheKey { // Access only through an std::atomic_ref instance atomically. int8_t reference_count_; // Keys are restricted to be 48-bit unsigned integers. - uint16_t key_upper_; - uint32_t key_lower_; + uint16_t key_higher_16_bits_; + uint32_t key_lower_32_bits_; int64_t position_in_cache_; };