Lines Matching defs:chunk

70 // The memory chunk allocated from the underlying allocator looks like this:
151 // The chunk is allocated and not yet freed.
153 // The chunk was freed and put into quarantine zone.
203 // contents of deallocated chunk, confusing GetAsanChunk lookup.
253 // We are about to unmap a chunk of user memory.
346 void RePoisonChunk(uptr chunk) {
347 // This could be a user-facing chunk (with redzones), or some internal
348 // housekeeping chunk, like TransferBatch. Start by assuming the former.
349 AsanChunk *ac = GetAsanChunk((void *)chunk);
350 uptr allocated_size = allocator.GetActuallyAllocatedSize((void *)chunk);
355 uptr chunk_end = chunk + allocated_size;
356 if (chunk < beg && beg < end && end <= chunk_end) {
358 PoisonShadow(chunk, beg - chunk, kAsanHeapLeftRedzoneMagic);
369 PoisonShadow(chunk, allocated_size, kAsanHeapLeftRedzoneMagic);
381 [](uptr chunk, void *alloc) {
382 ((Allocator *)alloc)->RePoisonChunk(chunk);
437 // Prefer an allocated chunk over freed chunk and freed chunk
438 // over available chunk.
541 // chunk. This is possible if CanPoisonMemory() was false for some
604 // Set quarantine flag if chunk is allocated, issue ASan error report on
614 // It's not safe to push a chunk in quarantine on invalid free.
623 // Expects the chunk to already be marked as quarantined by using
633 // We have to skip the chunk header, it contains free_context_id.
683 // Must mark the chunk as quarantined before any changes to its metadata.
684 // Do not quarantine given chunk if we failed to set CHUNK_QUARANTINE flag.
805 // The address is in the chunk's left redzone, so maybe it is actually
806 // a right buffer overflow from the other chunk before.
807 // Search a bit before to see if there is another chunk.
811 if (m2 == m1) continue; // Still the same chunk.
1088 uptr chunk = m->Beg();
1090 return chunk;
1091 if (IsSpecialCaseOfOperatorNew0(chunk, m->UsedSize(), addr))
1092 return chunk;
1096 uptr GetUserBegin(uptr chunk) {
1097 // FIXME: All usecases provide chunk address, GetAsanChunkByAddrFastLocked is
1099 __asan::AsanChunk *m = __asan::instance.GetAsanChunkByAddrFastLocked(chunk);
1103 LsanMetadata::LsanMetadata(uptr chunk) {
1104 metadata_ = chunk ? reinterpret_cast<void *>(chunk - __asan::kChunkHeaderSize)