Lines Matching refs:Alignment
302 void *allocate(uptr Size, uptr Alignment, AllocType Type, in allocate()
306 if (UNLIKELY(Alignment > MaxAlignment)) { in allocate()
309 reportAllocationAlignmentTooBig(Alignment, MaxAlignment); in allocate()
311 if (UNLIKELY(Alignment < MinAlignment)) in allocate()
312 Alignment = MinAlignment; in allocate()
316 if (void *Ptr = GuardedAlloc.allocate(Size, Alignment)) { in allocate()
326 const uptr AlignedSize = (Alignment > MinAlignment) ? in allocate()
327 NeededSize + (Alignment - Chunk::getHeaderSize()) : NeededSize; in allocate()
358 BackendPtr = Backend.allocateSecondary(BackendSize, Alignment); in allocate()
373 if (UNLIKELY(!IsAligned(UserPtr, Alignment))) { in allocate()
378 const uptr AlignedUserPtr = RoundUpTo(UserPtr, Alignment); in allocate()
701 void *scudoAllocate(uptr Size, uptr Alignment, AllocType Type) { in scudoAllocate() argument
702 if (Alignment && UNLIKELY(!IsPowerOfTwo(Alignment))) { in scudoAllocate()
706 reportAllocationAlignmentNotPowerOfTwo(Alignment); in scudoAllocate()
708 return SetErrnoOnNull(Instance.allocate(Size, Alignment, Type)); in scudoAllocate()
711 void scudoDeallocate(void *Ptr, uptr Size, uptr Alignment, AllocType Type) { in scudoDeallocate() argument
712 Instance.deallocate(Ptr, Size, Alignment, Type); in scudoDeallocate()
747 int scudoPosixMemalign(void **MemPtr, uptr Alignment, uptr Size) { in scudoPosixMemalign() argument
748 if (UNLIKELY(!CheckPosixMemalignAlignment(Alignment))) { in scudoPosixMemalign()
750 reportInvalidPosixMemalignAlignment(Alignment); in scudoPosixMemalign()
753 void *Ptr = Instance.allocate(Size, Alignment, FromMemalign); in scudoPosixMemalign()
760 void *scudoAlignedAlloc(uptr Alignment, uptr Size) { in scudoAlignedAlloc() argument
761 if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(Alignment, Size))) { in scudoAlignedAlloc()
765 reportInvalidAlignedAllocAlignment(Size, Alignment); in scudoAlignedAlloc()
767 return SetErrnoOnNull(Instance.allocate(Size, Alignment, FromMalloc)); in scudoAlignedAlloc()