Lines Matching refs:Chunk
68 class Chunk;
81 void MoveToFullList(Chunk* chunk, int bucket_);
82 void MoveToFreeList(Chunk* chunk, int bucket_);
87 LinkedList<Chunk*> free_chunks_[kNumBuckets];
88 LinkedList<Chunk*> full_chunks_[kNumBuckets];
90 void MoveToList(Chunk* chunk, LinkedList<Chunk*>* head);
164 class Chunk { class
168 Chunk(HeapImpl* heap, int bucket);
169 ~Chunk() {} in ~Chunk()
176 static Chunk* ptr_to_chunk(void* ptr) { in ptr_to_chunk()
177 return reinterpret_cast<Chunk*>(reinterpret_cast<uintptr_t>(ptr) & ~(kChunkSize - 1)); in ptr_to_chunk()
185 LinkedList<Chunk*> node_; // linked list sorted by minimum free count
188 DISALLOW_COPY_AND_ASSIGN(Chunk);
211 static_assert(sizeof(Chunk) <= kPageSize, "header must fit in page");
214 void* Chunk::operator new(std::size_t count __attribute__((unused))) noexcept { in operator new()
215 assert(count == sizeof(Chunk)); in operator new()
225 void Chunk::operator delete(void* ptr) { in operator delete()
226 assert(reinterpret_cast<Chunk*>(ptr) == ptr_to_chunk(ptr)); in operator delete()
230 Chunk::Chunk(HeapImpl* heap, int bucket) in Chunk() function in android::Chunk
243 bool Chunk::Empty() { in Empty()
247 void* Chunk::Alloc() { in Alloc()
271 void Chunk::Free(void* ptr) { in Free()
299 void Chunk::Purge() { in Purge()
325 for (LinkedList<Chunk*>* it = free_chunks_[i].next(); it->data() != NULL; it = it->next()) { in Empty()
330 for (LinkedList<Chunk*>* it = full_chunks_[i].next(); it->data() != NULL; it = it->next()) { in Empty()
343 Chunk* chunk = free_chunks_[i].next()->data(); in ~HeapImpl()
348 Chunk* chunk = full_chunks_[i].next()->data(); in ~HeapImpl()
366 Chunk* chunk = new Chunk(this, bucket); in AllocLocked()
378 if (!Chunk::is_chunk(ptr)) { in FreeLocked()
381 Chunk* chunk = Chunk::ptr_to_chunk(ptr); in FreeLocked()
416 void HeapImpl::MoveToFreeList(Chunk* chunk, int bucket) { in MoveToFreeList()
420 void HeapImpl::MoveToFullList(Chunk* chunk, int bucket) { in MoveToFullList()
424 void HeapImpl::MoveToList(Chunk* chunk, LinkedList<Chunk*>* head) { in MoveToList()
428 LinkedList<Chunk*>* node = head; in MoveToList()