fix slice_alloc.h uint32_t overflow bug
This commit is contained in:
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 {
|
class ObEmbedFixedQueue {
|
||||||
public:
|
public:
|
||||||
ObEmbedFixedQueue() : push_(0), pop_(0), capacity_(0)
|
ObEmbedFixedQueue(): push_(0), pop_(0), capacity_(0) {}
|
||||||
{}
|
~ObEmbedFixedQueue() {}
|
||||||
~ObEmbedFixedQueue()
|
void init(uint64_t capacity) {
|
||||||
{}
|
|
||||||
void init(uint32_t capacity)
|
|
||||||
{
|
|
||||||
capacity_ = capacity;
|
capacity_ = capacity;
|
||||||
memset(data_, 0, sizeof(void*) * capacity);
|
memset(data_, 0, sizeof(void*) * capacity);
|
||||||
}
|
}
|
||||||
@ -120,9 +117,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t push_ CACHE_ALIGNED;
|
uint64_t push_ CACHE_ALIGNED;
|
||||||
uint32_t pop_ CACHE_ALIGNED;
|
uint64_t pop_ CACHE_ALIGNED;
|
||||||
uint32_t capacity_ CACHE_ALIGNED;
|
uint64_t capacity_ CACHE_ALIGNED;
|
||||||
void* data_[];
|
void* data_[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user