8 #ifndef CVMFS_BIGQUEUE_H_
9 #define CVMFS_BIGQUEUE_H_
28 Alloc(std::max(num_items, min_items));
94 void Alloc(
const size_t num_elements) {
95 size_t num_bytes =
sizeof(Item) * num_elements;
96 buffer_ =
static_cast<Item *
>(smmap(num_bytes));
117 for (
size_t i = 0; i <
size_; ++i)
118 new (
buffer_ + i) Item(old_buffer[head_offset + i]);
124 for (
size_t i = 0; i < nitems; ++i)
134 for (
size_t i = 0; i < other.
size_; ++i) {
146 #endif // CVMFS_BIGQUEUE_H_
BigQueue(const size_t num_items)
void Migrate(size_t new_capacity)
void Alloc(const size_t num_elements)
assert((mem||(size==0))&&"Out Of Memory")
BigQueue< Item > & operator=(const BigQueue< Item > &other)
void PushBack(const Item &item)
static const size_t kCompactThreshold
size_t GetAvailableSpace() const
static const size_t kNumInit
size_t GetHeadOffset() const
void FreeBuffer(Item *buf, const size_t nitems)
void CopyFrom(const BigQueue< Item > &other)
BigQueue(const BigQueue< Item > &other)