From 0df13a572f6ed032a47e62913572e09df10244e4 Mon Sep 17 00:00:00 2001 From: yq0 Date: Fri, 23 Jul 2021 12:12:25 +0800 Subject: [PATCH] fix slice_alloc.h uint32_t overflow bug --- deps/oblib/src/lib/allocator/ob_slice_alloc.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/deps/oblib/src/lib/allocator/ob_slice_alloc.h b/deps/oblib/src/lib/allocator/ob_slice_alloc.h index eb9e6442c4..1fb06526b1 100644 --- a/deps/oblib/src/lib/allocator/ob_slice_alloc.h +++ b/deps/oblib/src/lib/allocator/ob_slice_alloc.h @@ -93,12 +93,9 @@ private: class ObEmbedFixedQueue { public: - ObEmbedFixedQueue() : push_(0), pop_(0), capacity_(0) - {} - ~ObEmbedFixedQueue() - {} - void init(uint32_t capacity) - { + ObEmbedFixedQueue(): push_(0), pop_(0), capacity_(0) {} + ~ObEmbedFixedQueue() {} + void init(uint64_t capacity) { capacity_ = capacity; memset(data_, 0, sizeof(void*) * capacity); } @@ -120,9 +117,9 @@ public: } private: - uint32_t push_ CACHE_ALIGNED; - uint32_t pop_ CACHE_ALIGNED; - uint32_t capacity_ CACHE_ALIGNED; + uint64_t push_ CACHE_ALIGNED; + uint64_t pop_ CACHE_ALIGNED; + uint64_t capacity_ CACHE_ALIGNED; void* data_[]; }; -- GitLab