Home | History | Annotate | Download | only in scudo

Lines Matching refs:Header

13 /// header, a delayed free list, and additional sanity checks.
60 // Our header requires 128-bit of storage on x64 (the only platform supported
66 // The header will be atomically loaded and stored using the 16-byte primitives
91 // prevent this, we work with a local copy of the header.
92 void *AllocBeg(UnpackedHeader *Header) {
94 reinterpret_cast<uptr>(this) - (Header->Offset << MinAlignmentLog));
99 u16 Checksum(UnpackedHeader *Header) const {
101 memcpy(HeaderHolder, Header, sizeof(HeaderHolder));
104 // significant bits of the first 8 bytes of the header, hence zero-ing
112 // Loads and unpacks the header, verifying the checksum in the process.
122 dieWithMessage("ERROR: corrupted chunk header at address %p\n", this);
126 // Packs and stores the header, computing the checksum in the process.
135 // Packs and stores the header, computing the checksum in the process. We
136 // compare the current header with the expected provided one to ensure that
149 dieWithMessage("ERROR: race on chunk header at address %p\n", this);
211 UnpackedHeader Header;
212 Chunk->loadHeader(&Header);
213 if (Header.State != ChunkQuarantine) {
217 void *Ptr = Chunk->AllocBeg(&Header);
291 // Verify that the header offset field can hold the maximum offset. In the
293 // MaxAlignment, so in order to store the header and still be aligned, we
297 UnpackedHeader Header = {};
299 Header.Offset = MaximumOffset;
300 if (Header.Offset != MaximumOffset) {
302 "header\n");
361 UnpackedHeader Header = {};
362 Header.State = ChunkAllocated;
363 Header.Offset = (ChunkBeg - ChunkHeaderSize - AllocBeg) >> MinAlignmentLog;
364 Header.AllocType = Type;
365 Header.RequestedSize = Size;
366 Header.Salt = static_cast<u16>(Prng.Next());
367 Chunk->storeHeader(&Header);
429 // header, we will return it in the second parameter, as it can be required
431 uptr getUsableSize(const void *Ptr, UnpackedHeader *Header) {
439 Chunk->loadHeader(Header);
441 if (Header->State != ChunkAllocated) {
446 BackendAllocator.GetActuallyAllocatedSize(Chunk->AllocBeg(Header));
450 // the end of the 'user' allocation, hence us subtracting the header size
454 return Size - ChunkHeaderSize - (Header->Offset << MinAlignmentLog);
457 // Helper function that doesn't care about the header.
459 UnpackedHeader Header;
460 return getUsableSize(Ptr, &Header);