Lines Matching refs:OldPtr
522 void *reallocate(void *OldPtr, uptr NewSize, uptr Alignment = MinAlignment) {
532 void *OldTaggedPtr = OldPtr;
533 OldPtr = untagPointerMaybe(OldPtr);
536 DCHECK_NE(OldPtr, nullptr);
540 if (UNLIKELY(GuardedAlloc.pointerIsMine(OldPtr))) {
541 uptr OldSize = GuardedAlloc.getSize(OldPtr);
544 memcpy(NewPtr, OldPtr, (NewSize < OldSize) ? NewSize : OldSize);
545 GuardedAlloc.deallocate(OldPtr);
550 if (UNLIKELY(!isAligned(reinterpret_cast<uptr>(OldPtr), MinAlignment)))
551 reportMisalignedPointer(AllocatorAction::Reallocating, OldPtr);
554 Chunk::loadHeader(Cookie, OldPtr, &OldHeader);
557 reportInvalidChunkState(AllocatorAction::Reallocating, OldPtr);
564 reportDeallocTypeMismatch(AllocatorAction::Reallocating, OldPtr,
569 void *BlockBegin = getBlockBegin(OldPtr, &OldHeader);
580 (reinterpret_cast<uptr>(OldPtr) + OldHeader.SizeOrUnusedBytes);
585 if (reinterpret_cast<uptr>(OldPtr) + NewSize <= BlockEnd) {
590 : BlockEnd - (reinterpret_cast<uptr>(OldPtr) + NewSize)) &
592 Chunk::compareExchangeHeader(Cookie, OldPtr, &NewHeader, &OldHeader);
597 storeAllocationStackMaybe(Options, OldPtr);
609 const uptr OldSize = getSize(OldPtr, &OldHeader);
611 quarantineOrDeallocateChunk(Options, OldPtr, &OldHeader, OldSize);