15 while (chunk !=
nullptr) {
28 chunk->
buffer.push_back(slot);
32 if (other->head_ ==
nullptr) {
35 if (
head_ ==
nullptr) {
42 other->head_ =
nullptr;
43 other->tail_ =
nullptr;
59 chunk->
buffer.reserve(capacity);
77template <
typename Callback>
80 if (ranges.empty())
return;
83 while (chunk !=
nullptr) {
88 FreeRangesMap::const_iterator upper_bound = ranges.upper_bound(
offset);
89 if (upper_bound == ranges.begin())
continue;
94 if (upper_bound->second >
offset) {
static constexpr T decode(U value)
static constexpr U encode(T value)
std::map< uint32_t, uint32_t > FreeRangesMap
void ClearInvalidSlots(const FreeRangesMap &invalid_ranges)
Chunk * LoadNext(Chunk *chunk)
void AssertNoInvalidSlots(const FreeRangesMap &invalid_ranges)
static TypedSlot ClearedTypedSlot()
void IterateSlotsInRanges(Callback callback, const FreeRangesMap &invalid_ranges)
static const size_t kInitialBufferSize
Chunk * NewChunk(Chunk *next, size_t capacity)
static size_t NextCapacity(size_t capacity)
void Insert(SlotType type, uint32_t offset)
void Merge(TypedSlots *other)
#define DCHECK_LE(v1, v2)
#define CHECK_WITH_MSG(condition, message)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
std::vector< TypedSlot > buffer