Home | History | Annotate | Download | only in Support

Lines Matching refs:Alignment

574 /// alignment that may be assumed after adding the two together.
584 /// \brief Aligns \c Addr to \c Alignment bytes, rounding up.
586 /// Alignment should be a power of two. This method rounds up, so
588 inline uintptr_t alignAddr(const void *Addr, size_t Alignment) {
589 assert(Alignment && isPowerOf2_64((uint64_t)Alignment) &&
590 "Alignment is not a power of two!");
592 assert((uintptr_t)Addr + Alignment - 1 >= (uintptr_t)Addr);
594 return (((uintptr_t)Addr + Alignment - 1) & ~(uintptr_t)(Alignment - 1));
597 /// \brief Returns the necessary adjustment for aligning \c Ptr to \c Alignment
599 inline size_t alignmentAdjustment(const void *Ptr, size_t Alignment) {
600 return alignAddr(Ptr, Alignment) - (uintptr_t)Ptr;