From 09f414e0f4ba3ec7e8bd855c4953d5e53e427e31 Mon Sep 17 00:00:00 2001 From: hqx871 Date: Tue, 4 Jul 2023 16:10:05 +0800 Subject: [PATCH] fix lru cache handle field order (#21435) For LRUHandle, all fields should be put ahead of key_data. The LRUHandle is allocated using malloc and starting from field key_data is for key data. --- be/src/olap/lru_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/olap/lru_cache.h b/be/src/olap/lru_cache.h index 4a9d45b07f..58c877bbe3 100644 --- a/be/src/olap/lru_cache.h +++ b/be/src/olap/lru_cache.h @@ -254,8 +254,8 @@ struct LRUHandle { uint32_t hash; // Hash of key(); used for fast sharding and comparisons CachePriority priority = CachePriority::NORMAL; MemTrackerLimiter* mem_tracker; - char key_data[1]; // Beginning of key LRUCacheType type; + char key_data[1]; // Beginning of key CacheKey key() const { // For cheaper lookups, we allow a temporary Handle object