fix slice_alloc.h uint32_t overflow bug
This commit is contained in:
parent
3fa7f39778
commit
0df13a572f
15
deps/oblib/src/lib/allocator/ob_slice_alloc.h
vendored
15
deps/oblib/src/lib/allocator/ob_slice_alloc.h
vendored
@ -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_[];
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user