/freebsd-src/contrib/llvm-project/llvm/lib/CodeGen/ |
H A D | MachineFrameInfo.cpp | 31 void MachineFrameInfo::ensureMaxAlignment(Align Alignment) { in ensureMaxAlignment() argument 33 assert(Alignment <= StackAlignment && in ensureMaxAlignment() 34 "For targets without stack realignment, Alignment is out of limit!"); in ensureMaxAlignment() 35 if (MaxAlignment < Alignment) in ensureMaxAlignment() 36 MaxAlignment = Alignment; in ensureMaxAlignment() 39 /// Clamp the alignment if requested and emit a warning. 40 static inline Align clampStackAlignment(bool ShouldClamp, Align Alignment, in clampStackAlignment() argument 42 if (!ShouldClamp || Alignment <= StackAlignment) in clampStackAlignment() 43 return Alignment; in clampStackAlignment() 44 LLVM_DEBUG(dbgs() << "Warning: requested alignment " << DebugSt in clampStackAlignment() 51 CreateStackObject(uint64_t Size,Align Alignment,bool IsSpillSlot,const AllocaInst * Alloca,uint8_t StackID) CreateStackObject() argument 66 CreateSpillStackObject(uint64_t Size,Align Alignment) CreateSpillStackObject() argument 74 CreateVariableSizedObject(Align Alignment,const AllocaInst * Alloca) CreateVariableSizedObject() argument 92 Align Alignment = CreateFixedObject() local 105 Align Alignment = CreateFixedSpillStackObject() local 159 Align Alignment = getObjectAlign(i); estimateStackSize() local [all...] |
/freebsd-src/sys/dev/drm2/ |
H A D | drm_mm.h | 105 unsigned alignment, 111 unsigned alignment, 118 unsigned alignment) in drm_mm_get_block() argument 120 return drm_mm_get_block_generic(parent, size, alignment, 0, 0); in drm_mm_get_block() 124 unsigned alignment) in drm_mm_get_block_atomic() argument 126 return drm_mm_get_block_generic(parent, size, alignment, 0, 1); in drm_mm_get_block_atomic() 131 unsigned alignment, in drm_mm_get_block_range() argument 135 return drm_mm_get_block_range_generic(parent, size, alignment, 0, in drm_mm_get_block_range() 141 unsigned alignment, in drm_mm_get_color_block_range() argument 146 return drm_mm_get_block_range_generic(parent, size, alignment, color, in drm_mm_get_color_block_range() [all …]
|
H A D | drm_mm.c | 116 unsigned long size, unsigned alignment, in drm_mm_insert_helper() argument 130 if (alignment) { in drm_mm_insert_helper() 131 unsigned tmp = adj_start % alignment; in drm_mm_insert_helper() 133 adj_start += alignment - tmp; in drm_mm_insert_helper() 161 unsigned alignment, in drm_mm_get_block_generic() argument 171 drm_mm_insert_helper(hole_node, node, size, alignment, color); in drm_mm_get_block_generic() 183 unsigned long size, unsigned alignment, in drm_mm_insert_node_generic() argument 188 hole_node = drm_mm_search_free_generic(mm, size, alignment, in drm_mm_insert_node_generic() 193 drm_mm_insert_helper(hole_node, node, size, alignment, color); in drm_mm_insert_node_generic() 199 unsigned long size, unsigned alignment) in drm_mm_insert_node() argument [all …]
|
/freebsd-src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_allocator_report.cpp | 76 void NORETURN ReportInvalidAllocationAlignment(uptr alignment, in ReportInvalidAllocationAlignment() argument 79 ScopedAllocatorErrorReport report("invalid-allocation-alignment", stack); in ReportInvalidAllocationAlignment() 80 Report("ERROR: %s: invalid allocation alignment: %zd, alignment must be a " in ReportInvalidAllocationAlignment() 81 "power of two\n", SanitizerToolName, alignment); in ReportInvalidAllocationAlignment() 86 void NORETURN ReportInvalidAlignedAllocAlignment(uptr size, uptr alignment, in ReportInvalidAlignedAllocAlignment() argument 89 ScopedAllocatorErrorReport report("invalid-aligned-alloc-alignment", stack); in ReportInvalidAlignedAllocAlignment() 91 Report("ERROR: %s: invalid alignment requested in " in ReportInvalidAlignedAllocAlignment() 92 "aligned_alloc: %zd, alignment must be a power of two and the " in ReportInvalidAlignedAllocAlignment() 93 "requested size 0x%zx must be a multiple of alignment\n", in ReportInvalidAlignedAllocAlignment() 94 SanitizerToolName, alignment, size); in ReportInvalidAlignedAllocAlignment() [all …]
|
H A D | sanitizer_allocator_checks.h | 40 // Checks aligned_alloc() parameters, verifies that the alignment is a power of 41 // two and that the size is a multiple of alignment for POSIX implementation, 43 // of alignment. 44 inline bool CheckAlignedAllocAlignmentAndSize(uptr alignment, uptr size) { in CheckAlignedAllocAlignmentAndSize() argument 46 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckAlignedAllocAlignmentAndSize() 47 (size & (alignment - 1)) == 0; in CheckAlignedAllocAlignmentAndSize() 49 return alignment != 0 && size % alignment == 0; in CheckAlignedAllocAlignmentAndSize() 53 // Checks posix_memalign() parameters, verifies that alignment is a power of two 55 inline bool CheckPosixMemalignAlignment(uptr alignment) { in CheckPosixMemalignAlignment() argument 56 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckPosixMemalignAlignment() [all …]
|
H A D | sanitizer_allocator_combined.h | 44 void *Allocate(AllocatorCache *cache, uptr size, uptr alignment) { in Allocate() argument 48 if (size + alignment < size) { in Allocate() 50 "0x%zx bytes with 0x%zx alignment requested\n", in Allocate() 51 SanitizerToolName, size, alignment); in Allocate() 55 // If alignment requirements are to be fulfilled by the frontend allocator in Allocate() 56 // rather than by the primary or secondary, passing an alignment lower than in Allocate() 58 // alignment check. in Allocate() 59 if (alignment > 8) in Allocate() 60 size = RoundUpTo(size, alignment); in Allocate() 65 // alignment without such requirement, and allocating 'size' would use in Allocate() [all …]
|
/freebsd-src/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | ASanStackFrameLayout.cpp | 21 // We sort the stack variables by alignment (largest first) to minimize 22 // unnecessary large gaps due to alignment. 30 return a.Alignment > b.Alignment; in CompareVars() 33 // We also force minimal alignment for all vars to kMinAlignment so that vars 34 // with e.g. alignment 1 and alignment 16 do not get reordered by CompareVars. 39 // The resulting frame size is a multiple of Alignment. 41 uint64_t Alignment) { in VarAndRedzoneSize() argument 49 return alignTo(std::max(Res, 2 * Granularity), Alignment); in VarAndRedzoneSize() 62 Vars[i].Alignment = std::max(Vars[i].Alignment, kMinAlignment); in ComputeASanStackFrameLayout() 68 Layout.FrameAlignment = std::max(Granularity, Vars[0].Alignment); in ComputeASanStackFrameLayout() [all …]
|
/freebsd-src/contrib/jemalloc/include/jemalloc/internal/ |
H A D | jemalloc_internal_inlines_c.h | 67 ipallocztm(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero, in ipallocztm() argument 72 assert(usize == sz_sa2u(usize, alignment)); in ipallocztm() 78 ret = arena_palloc(tsdn, arena, usize, alignment, zero, tcache); in ipallocztm() 79 assert(ALIGNMENT_ADDR2BASE(ret, alignment) == ret); in ipallocztm() 87 ipalloct(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero, in ipalloct() argument 89 return ipallocztm(tsdn, usize, alignment, zero, tcache, false, arena); in ipalloct() 93 ipalloc(tsd_t *tsd, size_t usize, size_t alignment, bool zero) { in ipalloc() argument 94 return ipallocztm(tsd_tsdn(tsd), usize, alignment, zero, in ipalloc() 136 size_t alignment, bool zero, tcache_t *tcache, arena_t *arena, in iralloct_realign() argument 143 usize = sz_sa2u(size, alignment); in iralloct_realign() [all …]
|
/freebsd-src/sys/contrib/edk2/Include/Library/ |
H A D | MemoryAllocationLib.h | 99 Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment. 102 alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is 103 returned. If there is not enough memory at the specified alignment remaining to satisfy the 106 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 107 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). 110 @param Alignment The requested alignment of the allocation. Must be a power of two. 111 If Alignment is zero, then byte alignment is used. 120 IN UINTN Alignment 124 Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment. 127 alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is [all …]
|
/freebsd-src/contrib/llvm-project/clang/lib/AST/ |
H A D | RecordLayoutBuilder.cpp | 59 /// as alignment attributes on fields and pragmas in effect. 66 /// Overall record alignment in bits. 589 /// Alignment - The current alignment of the record layout. 590 CharUnits Alignment; member in __anon84cdfbc70111::ItaniumRecordLayoutBuilder 592 /// PreferredAlignment - The preferred alignment of the record layout. 595 /// The alignment if attribute packed is not used. 608 /// Whether we need to infer alignment, even when we have an 639 /// MaxFieldAlignment - The maximum allowed field alignment. This is set by 701 Alignment(CharUnit in ItaniumRecordLayoutBuilder() 2551 CharUnits Alignment; global() member 2616 CharUnits Alignment; global() member [all...] |
/freebsd-src/contrib/llvm-project/llvm/lib/IR/ |
H A D | DataLayout.cpp | 1 //===- DataLayout.cpp - Data size & alignment routines ---------------------==// 9 // This file defines layout properties related to datatype size/offset/alignment 65 // the same data type so no alignment issue will happen. The condition here in StructLayout() 74 // Keep track of maximum alignment constraint. in StructLayout() 127 assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!"); in get() 148 assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!"); in getInBits() 342 // ABI alignment. in parseSpecifier() 345 "Missing alignment specification for pointer in datalayout string"); in parseSpecifier() 352 return reportError("Pointer ABI alignment must be a power of 2"); in parseSpecifier() 358 // Preferred alignment in parseSpecifier() 466 uint64_t Alignment; parseSpecifier() local 487 uint64_t Alignment; parseSpecifier() local 1029 Align Alignment = getPrefTypeAlign(ElemType); getPreferredAlign() local [all...] |
/freebsd-src/contrib/llvm-project/libcxx/src/ |
H A D | new.cpp | 119 static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignment) { in operator_new_aligned_impl() 122 if (static_cast<size_t>(alignment) < sizeof(void*)) in operator_new_aligned_impl() 123 alignment = std::align_val_t(sizeof(void*)); in operator_new_aligned_impl() 129 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) { in operator_new_aligned_impl() 140 operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC { in operator new() 141 void* p = operator_new_aligned_impl(size, alignment); in operator new() 147 _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept { in operator new() 160 return operator_new_aligned_impl(size, alignment); in operator new() 164 p = ::operator new(size, alignment); in operator new() 172 operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLO in operator new[]() 118 operator_new_aligned_impl(std::size_t size,std::align_val_t alignment) operator_new_aligned_impl() argument 139 operator new(std::size_t size,std::align_val_t alignment) operator new() argument 146 operator new(size_t size,std::align_val_t alignment,const std::nothrow_t &) operator new() argument 171 operator new[](size_t size,std::align_val_t alignment) operator new[]() argument 175 operator new[](size_t size,std::align_val_t alignment,const std::nothrow_t &) operator new[]() argument 202 operator delete(void * ptr,std::align_val_t alignment,const std::nothrow_t &) operator delete() argument 206 operator delete(void * ptr,size_t,std::align_val_t alignment) operator delete() argument 210 operator delete[](void * ptr,std::align_val_t alignment) operator delete[]() argument 214 operator delete[](void * ptr,std::align_val_t alignment,const std::nothrow_t &) operator delete[]() argument 218 operator delete[](void * ptr,size_t,std::align_val_t alignment) operator delete[]() argument [all...] |
/freebsd-src/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
H A D | AlignmentFromAssumptions.cpp | 13 // complex alignment assumptions that apply to vector loads and stores that 34 #define DEBUG_TYPE "alignment-from-assumptions" 38 "Number of loads changed by alignment assumptions"); 40 "Number of stores changed by alignment assumptions"); 42 "Number of memory intrinsics changed by alignment assumptions"); 44 // Given an expression for the (constant) alignment, AlignSCEV, and an 46 // DiffSCEV, compute the alignment of the displaced pointer if it can be reduced 47 // to a constant. Using SCEV to compute alignment handles the case where 53 // DiffUnits = Diff % int64_t(Alignment) in getNewAlignmentDiff() 63 // If the displacement is an exact multiple of the alignment, then the in getNewAlignmentDiff() [all …]
|
/freebsd-src/sys/contrib/ncsw/etc/ |
H A D | ncsw_mem.c | 48 #define ALIGN_BLOCK(p_Block, prefixSize, alignment) \ 51 p_Block += PAD_ALIGNMENT((alignment), (uintptr_t)(p_Block)); \ 182 ALIGN_BLOCK(p_Temp, p_Mem->prefixSize, p_Mem->alignment); 185 p_Temp += p_Mem->alignment; 213 uint16_t alignment) 217 /* Make sure that the alignment is at least 4 */ 218 if (alignment < 4) 220 alignment = 4; 226 pad2 = PAD_ALIGNMENT(alignment, blockSize); 230 return ((num * blockSize) + alignment); [all …]
|
/freebsd-src/contrib/llvm-project/llvm/include/llvm/IR/ |
H A D | DataLayout.h | 1 //===- llvm/DataLayout.h - Data size & alignment info -----------*- C++ -*-===// 9 // This file defines layout properties related to datatype size/offset/alignment 29 #include "llvm/Support/Alignment.h" 53 /// Enum used to categorize the alignment types stored by LayoutAlignElem 61 // FIXME: Currently the DataLayout string carries a "preferred alignment" 66 /// Layout alignment element. 68 /// Stores the alignment data associated with a given type bit width. 83 /// Layout pointer alignment element. 85 /// Stores the alignment data associated with a given pointer and address space. 113 /// The function pointer alignment i 267 exceedsNaturalStackAlignment(Align Alignment) exceedsNaturalStackAlignment() argument 526 getValueOrABITypeAlignment(MaybeAlign Alignment,Type * Ty) getValueOrABITypeAlignment() argument [all...] |
/freebsd-src/contrib/llvm-project/llvm/lib/Support/ |
H A D | OptimizedStructLayout.cpp | 28 assert(isAligned(Field.Alignment, Field.Offset) && in checkValidLayout() 33 assert(Field.Alignment <= MaxAlign && in checkValidLayout() 35 ComputedMaxAlign = std::max(Field.Alignment, MaxAlign); in checkValidLayout() 72 MaxAlign = std::max(MaxAlign, FirstFlexible->Alignment); in performOptimizedStructLayout() 97 MaxAlign = std::max(MaxAlign, I->Alignment); in performOptimizedStructLayout() 101 // Sort the flexible elements in order of decreasing alignment, in performOptimizedStructLayout() 108 // Decreasing alignment. in performOptimizedStructLayout() 109 if (lhs->Alignment != rhs->Alignment) in performOptimizedStructLayout() 110 return (lhs->Alignment < rhs->Alignment ? 1 : -1); in performOptimizedStructLayout() 130 // of their alignment, then this will reliably trigger. in performOptimizedStructLayout() [all …]
|
/freebsd-src/contrib/llvm-project/compiler-rt/lib/scudo/standalone/ |
H A D | report.cpp | 80 // We enforce a maximum alignment, to keep fields smaller and generally prevent 82 void NORETURN reportAlignmentTooBig(uptr Alignment, uptr MaxAlignment) { in reportAlignmentTooBig() argument 84 Report.append("invalid allocation alignment: %zu exceeds maximum supported " in reportAlignmentTooBig() 85 "alignment of %zu\n", in reportAlignmentTooBig() 86 Alignment, MaxAlignment); in reportAlignmentTooBig() 155 void NORETURN reportAlignmentNotPowerOfTwo(uptr Alignment) { in reportAlignmentNotPowerOfTwo() argument 158 "invalid allocation alignment: %zu, alignment must be a power of two\n", in reportAlignmentNotPowerOfTwo() 159 Alignment); in reportAlignmentNotPowerOfTwo() 169 void NORETURN reportInvalidPosixMemalignAlignment(uptr Alignment) { in reportInvalidPosixMemalignAlignment() argument 172 "invalid alignment requested in posix_memalign: %zu, alignment must be a " in reportInvalidPosixMemalignAlignment() [all …]
|
H A D | wrappers_c_checks.h | 31 // Checks aligned_alloc() parameters, verifies that the alignment is a power of 32 // two and that the size is a multiple of alignment. 33 inline bool checkAlignedAllocAlignmentAndSize(uptr Alignment, uptr Size) { in checkAlignedAllocAlignmentAndSize() argument 34 return !isPowerOfTwo(Alignment) || !isAligned(Size, Alignment); in checkAlignedAllocAlignmentAndSize() 37 // Checks posix_memalign() parameters, verifies that alignment is a power of two 39 inline bool checkPosixMemalignAlignment(uptr Alignment) { 40 return !isPowerOfTwo(Alignment) || !isAligned(Alignment, sizeof(void *)); in checkPosixMemalignAlignment() argument
|
/freebsd-src/contrib/llvm-project/openmp/runtime/src/ |
H A D | kmp_barrier.h | 21 #define KMP_ALIGNED_ALLOCATE(size, alignment) _mm_malloc(size, alignment) argument 24 #define KMP_ALGIN_UP(val, alignment) \ argument 25 (((val) + (alignment)-1) / (alignment) * (alignment)) 26 #define KMP_ALIGNED_ALLOCATE(size, alignment) \ argument 27 aligned_alloc(alignment, KMP_ALGIN_UP(size, alignment)) 30 static inline void *KMP_ALIGNED_ALLOCATE(size_t size, size_t alignment) { in KMP_ALIGNED_ALLOCATE() argument 32 int n = posix_memalign(&ptr, alignment, size); in KMP_ALIGNED_ALLOCATE() 43 #define KMP_ALIGNED_ALLOCATE(size, alignment) _aligned_malloc(size, alignment) argument 46 #define KMP_ALIGNED_ALLOCATE(size, alignment) KMP_INTERNAL_MALLOC(size) argument
|
/freebsd-src/contrib/llvm-project/compiler-rt/lib/gwp_asan/ |
H A D | guarded_pool_allocator.cpp | 169 // alignment, we don't need to allocate extra padding to ensure the alignment in getRequiredBackingSize() argument 172 size_t Alignment, in getRequiredBackingSize() 174 assert(isPowerOfTwo(Alignment) && "Alignment must be a power of two!"); in getRequiredBackingSize() 175 assert(Alignment != 0 && "Alignment should be non-zero"); in getRequiredBackingSize() 178 if (Alignment <= PageSize) in getRequiredBackingSize() 181 return Size + Alignment - PageSize; in alignUp() argument 184 uintptr_t GuardedPoolAllocator::alignUp(uintptr_t Ptr, size_t Alignment) { in alignUp() 191 alignDown(uintptr_t Ptr,size_t Alignment) alignDown() argument 201 allocate(size_t Size,size_t Alignment) allocate() argument [all...] |
/freebsd-src/contrib/jemalloc/src/ |
H A D | base.c | 37 /* Use huge page sizes and alignment regardless of opt_metadata_thp. */ in base_map() 39 size_t alignment = HUGEPAGE; in base_map() local 41 addr = extent_alloc_mmap(NULL, size, alignment, &zero, &commit); in base_map() 46 addr = extent_hooks->alloc(extent_hooks, NULL, size, alignment, in base_map() 181 size_t alignment) { in base_extent_bump_alloc_helper() argument 184 assert(alignment == ALIGNMENT_CEILING(alignment, QUANTUM)); in base_extent_bump_alloc_helper() 185 assert(size == ALIGNMENT_CEILING(size, alignment)); in base_extent_bump_alloc_helper() 188 alignment) - (uintptr_t)extent_addr_get(extent); in base_extent_bump_alloc_helper() 233 size_t alignment) { in base_extent_bump_alloc() argument 237 ret = base_extent_bump_alloc_helper(extent, &gap_size, size, alignment); in base_extent_bump_alloc() [all …]
|
/freebsd-src/contrib/llvm-project/llvm/include/llvm/Support/ |
H A D | Endian.h | 33 /// ::value is either alignment, or alignof(T) if alignment is 0. 34 template<class T, int alignment> 36 enum { value = alignment == 0 ? alignof(T) : alignment }; 57 template <typename value_type, std::size_t alignment = unaligned> 63 memory, (detail::PickAlignment<value_type, alignment>::value)), in read() 68 template <typename value_type, endianness endian, std::size_t alignment> 70 return read<value_type, alignment>(memory, endian); in read() 75 template <typename value_type, std::size_t alignment 204 static constexpr std::size_t alignment = Alignment; global() member [all...] |
H A D | Alignment.h | 1 //===-- llvm/Support/Alignment.h - Useful alignment functions ---*- C++ -*-===// 13 // - Align represents an alignment in bytes, it is always set and always a valid 14 // power of two, its minimum value is 1 which means no alignment requirements. 37 /// alignment. 41 uint8_t ShiftValue = 0; /// The log2 of the required alignment. 78 assert(llvm::isPowerOf2_64(Value) && "Alignment is not a power of 2"); in Align() 87 // Returns the previous alignment. 116 /// undefined (0) alignment. 135 "Alignment is neither 0 nor a power of 2"); in MaybeAlign() 140 /// For convenience, returns a valid alignment or 1 if undefined. [all …]
|
/freebsd-src/contrib/unbound/util/ |
H A D | regional.c | 47 #ifdef ALIGNMENT 48 # undef ALIGNMENT 50 /** increase size until it fits alignment of s bytes */ 53 #define ALIGNMENT (sizeof(uint64_t)) macro 75 size_t a = ALIGN_UP(sizeof(struct regional), ALIGNMENT); in regional_init() 93 size = ALIGN_UP(size, ALIGNMENT); in regional_create_custom_large_object() 158 a = ALIGN_UP(size, ALIGNMENT); in regional_alloc() 161 s = malloc(ALIGNMENT + size); in regional_alloc() 163 r->total_large += ALIGNMENT+size; in regional_alloc() 166 return (char*)s+ALIGNMENT; in regional_alloc() [all …]
|
/freebsd-src/contrib/llvm-project/llvm/lib/ExecutionEngine/ |
H A D | SectionMemoryManager.cpp | 22 unsigned Alignment, in allocateDataSection() argument 28 Size, Alignment); in allocateDataSection() 30 Alignment); in allocateDataSection() 34 unsigned Alignment, in allocateCodeSection() argument 38 Alignment); in allocateCodeSection() 43 unsigned Alignment) { in allocateSection() argument 44 if (!Alignment) in allocateSection() 45 Alignment = 16; in allocateSection() 47 assert(!(Alignment & (Alignment - 1)) && "Alignment must be a power of two."); in allocateSection() 49 uintptr_t RequiredSize = Alignment * ((Size + Alignment - 1) / Alignment + 1); in allocateSection() [all …]
|