/freebsd/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/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() argument 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() argument 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&) noe… in operator new() argument 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_ALLOC { in operator new[]() argument [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_allocator_checks.h | 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() 55 inline bool CheckPosixMemalignAlignment(uptr alignment) { in CheckPosixMemalignAlignment() argument 56 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckPosixMemalignAlignment() 57 (alignment % sizeof(void *)) == 0; in CheckPosixMemalignAlignment()
|
H A D | sanitizer_allocator.cpp | 50 uptr alignment) { in RawInternalAlloc() argument 51 if (alignment == 0) alignment = 8; in RawInternalAlloc() 55 alignment); in RawInternalAlloc() 57 return internal_allocator()->Allocate(cache, size, alignment); in RawInternalAlloc() 62 uptr alignment = 8; in RawInternalRealloc() local 66 size, alignment); in RawInternalRealloc() 68 return internal_allocator()->Reallocate(cache, ptr, size, alignment); in RawInternalRealloc() 86 void *InternalAlloc(uptr size, InternalAllocatorCache *cache, uptr alignment) { in InternalAlloc() argument 87 void *p = RawInternalAlloc(size, cache, alignment); in InternalAlloc() 167 void SetLowLevelAllocateMinAlignment(uptr alignment) { in SetLowLevelAllocateMinAlignment() argument [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() 51 SanitizerToolName, size, alignment); in Allocate() 59 if (alignment > 8) in Allocate() 60 size = RoundUpTo(size, alignment); in Allocate() 68 if (primary_.CanAllocate(size, alignment)) in Allocate() 71 res = secondary_.Allocate(&stats_, original_size, alignment); in Allocate() 72 if (alignment > 8) in Allocate() 73 CHECK_EQ(reinterpret_cast<uptr>(res) & (alignment - 1), 0); in Allocate() 98 uptr alignment) { in Reallocate() argument [all …]
|
H A D | sanitizer_allocator_report.cpp | 76 void NORETURN ReportInvalidAllocationAlignment(uptr alignment, in ReportInvalidAllocationAlignment() argument 81 "power of two\n", SanitizerToolName, alignment); in ReportInvalidAllocationAlignment() 86 void NORETURN ReportInvalidAlignedAllocAlignment(uptr size, uptr alignment, in ReportInvalidAlignedAllocAlignment() argument 94 SanitizerToolName, alignment, size); in ReportInvalidAlignedAllocAlignment() 98 SanitizerToolName, alignment, size); in ReportInvalidAlignedAllocAlignment() 104 void NORETURN ReportInvalidPosixMemalignAlignment(uptr alignment, in ReportInvalidPosixMemalignAlignment() argument 113 SanitizerToolName, alignment, sizeof(void *)); in ReportInvalidPosixMemalignAlignment()
|
/freebsd/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 …]
|
H A D | jemalloc_internal_types.h | 85 #define ALIGNMENT_ADDR2BASE(a, alignment) \ argument 86 ((void *)((uintptr_t)(a) & ((~(alignment)) + 1))) 89 #define ALIGNMENT_ADDR2OFFSET(a, alignment) \ argument 90 ((size_t)((uintptr_t)(a) & (alignment - 1))) 93 #define ALIGNMENT_CEILING(s, alignment) \ argument 94 (((s) + (alignment - 1)) & ((~(alignment)) + 1))
|
/freebsd/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) 218 if (alignment < 4) 220 alignment = 4; 226 pad2 = PAD_ALIGNMENT(alignment, blockSize); 230 return ((num * blockSize) + alignment); 240 uint16_t alignment) [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/ |
H A D | Endian.h | 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 = unaligned, 79 value_type ret = read<value_type, alignment>(memory, endian); in readNext() 85 std::size_t alignment = unaligned, typename CharT> 87 return readNext<value_type, alignment, CharT>(memory, endian); in readNext() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/dfsan/ |
H A D | dfsan_allocator.cpp | 91 static void *DFsanAllocate(uptr size, uptr alignment, bool zeroise) { in DFsanAllocate() argument 111 allocated = allocator.Allocate(cache, size, alignment); in DFsanAllocate() 115 allocated = allocator.Allocate(cache, size, alignment); in DFsanAllocate() 154 void *DFsanReallocate(void *old_p, uptr new_size, uptr alignment) { in DFsanReallocate() argument 166 void *new_p = DFsanAllocate(new_size, alignment, false /*zeroise*/); in DFsanReallocate() 260 void *dfsan_aligned_alloc(uptr alignment, uptr size) { in dfsan_aligned_alloc() argument 261 if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(alignment, size))) { in dfsan_aligned_alloc() 266 ReportInvalidAlignedAllocAlignment(size, alignment, &stack); in dfsan_aligned_alloc() 268 return SetErrnoOnNull(DFsanAllocate(size, alignment, false /*zeroise*/)); in dfsan_aligned_alloc() 271 void *dfsan_memalign(uptr alignment, uptr size) { in dfsan_memalign() argument [all …]
|
/freebsd/sys/dev/qat/qat_api/qat_utils/src/ |
H A D | QatUtilsServices.c | 44 qatUtilsMemAllocContiguousNUMA(uint32_t size, uint32_t node, uint32_t alignment) in qatUtilsMemAllocContiguousNUMA() argument 51 if (size == 0 || alignment < 1) { in qatUtilsMemAllocContiguousNUMA() 53 "QatUtilsMemAllocNUMA: size or alignment are zero.\n"); in qatUtilsMemAllocContiguousNUMA() 56 if (alignment & (alignment - 1)) { in qatUtilsMemAllocContiguousNUMA() 58 "QatUtilsMemAllocNUMA: Expecting alignment of a power.\n"); in qatUtilsMemAllocContiguousNUMA() 62 memInfo.mSize = size + alignment + sizeof(QatUtilsMemAllocInfoStruct); in qatUtilsMemAllocContiguousNUMA() 69 alignment_offset = (uint64_t)pRet % alignment; in qatUtilsMemAllocContiguousNUMA() 71 alignment_offset = (uint32_t)pRet % alignment; in qatUtilsMemAllocContiguousNUMA() 73 pRet = (char *)pRet + (alignment in qatUtilsMemAllocContiguousNUMA() [all...] |
/freebsd/contrib/llvm-project/compiler-rt/lib/hwasan/ |
H A D | hwasan_allocation_functions.cpp | 43 int __sanitizer_posix_memalign(void **memptr, uptr alignment, uptr size) { in __sanitizer_posix_memalign() argument 46 int res = hwasan_posix_memalign(memptr, alignment, size, &stack); in __sanitizer_posix_memalign() 51 void *__sanitizer_memalign(uptr alignment, uptr size) { in __sanitizer_memalign() argument 53 return hwasan_memalign(alignment, size, &stack); in __sanitizer_memalign() 57 void *__sanitizer_aligned_alloc(uptr alignment, uptr size) { in __sanitizer_aligned_alloc() argument 59 return hwasan_aligned_alloc(alignment, size, &stack); in __sanitizer_aligned_alloc() 63 void *__sanitizer___libc_memalign(uptr alignment, uptr size) { in __sanitizer___libc_memalign() argument 65 void *ptr = hwasan_memalign(alignment, size, &stack); in __sanitizer___libc_memalign() 171 INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment, 173 INTERCEPTOR_ALIAS(void *, aligned_alloc, SIZE_T alignment, SIZE_T size); [all …]
|
/freebsd/contrib/jemalloc/src/ |
H A D | base.c | 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() 250 size_t alignment) { in base_block_alloc() argument [all …]
|
/freebsd/sys/arm64/arm64/ |
H A D | busdma_machdep.c | 54 bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr, in common_bus_dma_tag_create() argument 80 common->alignment = alignment; in common_bus_dma_tag_create() 101 common->alignment = MAX(parent->alignment, common->alignment); in common_bus_dma_tag_create() 121 bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, in bus_dma_tag_create() argument 135 error = bus_dma_bounce_impl.tag_create(parent, alignment, in bus_dma_tag_create() 140 error = tc->impl->tag_create(parent, alignment, in bus_dma_tag_create() 157 t->alignment = common->alignment; in bus_dma_template_clone()
|
/freebsd/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) \ 27 aligned_alloc(alignment, KMP_ALGIN_UP(size, alignment)) in KMP_ALIGNED_ALLOCATE() argument 30 static inline void *KMP_ALIGNED_ALLOCATE(size_t size, size_t alignment) { in KMP_ALIGNED_ALLOCATE() 40 KMP_ALIGNED_ALLOCATE(size,alignment) global() argument 43 KMP_ALIGNED_ALLOCATE(size,alignment) global() argument [all...] |
/freebsd/sys/contrib/openzfs/tests/zfs-tests/cmd/ |
H A D | stride_dd.c | 24 static int alignment = 0; variable 86 invalid_alignment(int alignment) in invalid_alignment() argument 88 if ((alignment < 0) || (alignment & (alignment - 1)) || in invalid_alignment() 89 ((alignment % sizeof (void *)))) { in invalid_alignment() 105 alignment = sysconf(_SC_PAGE_SIZE); in parse_options() 113 alignment = atoi(optarg); in parse_options() 184 seek < 0 || invalid_alignment(alignment) || skip < 0) { in parse_options() 309 int err = posix_memalign(&buf, alignment, bsize); in main()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/lsan/ |
H A D | lsan_allocator.cpp | 90 void *Allocate(const StackTrace &stack, uptr size, uptr alignment, in Allocate() argument 101 void *p = allocator.Allocate(GetAllocatorCache(), size, alignment); in Allocate() 131 uptr alignment) { in Reallocate() argument 138 allocator.Reallocate(GetAllocatorCache(), p, new_size, alignment); in Reallocate() 179 int lsan_posix_memalign(void **memptr, uptr alignment, uptr size, in lsan_posix_memalign() argument 181 if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) { in lsan_posix_memalign() 184 ReportInvalidPosixMemalignAlignment(alignment, &stack); in lsan_posix_memalign() 186 void *ptr = Allocate(stack, size, alignment, kAlwaysClearMemory); in lsan_posix_memalign() 190 CHECK(IsAligned((uptr)ptr, alignment)); in lsan_posix_memalign() 195 void *lsan_aligned_alloc(uptr alignment, uptr size, const StackTrace &stack) { in lsan_aligned_alloc() argument [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/msan/ |
H A D | msan_allocator.cpp | 184 static void *MsanAllocate(BufferedStackTrace *stack, uptr size, uptr alignment, in MsanAllocate() argument 204 allocated = allocator.Allocate(cache, size, alignment); in MsanAllocate() 208 allocated = allocator.Allocate(cache, size, alignment); in MsanAllocate() 269 uptr new_size, uptr alignment) { in MsanReallocate() argument 285 void *new_p = MsanAllocate(stack, new_size, alignment, false /*zeroise*/); in MsanReallocate() 378 void *msan_aligned_alloc(uptr alignment, uptr size, BufferedStackTrace *stack) { in msan_aligned_alloc() argument 379 if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(alignment, size))) { in msan_aligned_alloc() 384 ReportInvalidAlignedAllocAlignment(size, alignment, stack); in msan_aligned_alloc() 386 return SetErrnoOnNull(MsanAllocate(stack, size, alignment, false)); in msan_aligned_alloc() 389 void *msan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack) { in msan_memalign() argument [all …]
|
/freebsd/sys/riscv/riscv/ |
H A D | busdma_machdep.c | 53 bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr, in common_bus_dma_tag_create() argument 79 common->alignment = alignment; in common_bus_dma_tag_create() 115 bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, in bus_dma_tag_create() argument 129 error = bus_dma_bounce_impl.tag_create(parent, alignment, in bus_dma_tag_create() 134 error = tc->impl->tag_create(parent, alignment, in bus_dma_tag_create() 151 t->alignment = common->alignment; in bus_dma_template_clone()
|
/freebsd/contrib/cortex-strings/scripts/ |
H A D | plot-sizes.py | 22 def plot(records, function, alignment=None, scale=1): argument 26 if alignment != None: 27 records = [x for x in records if x.src_alignment==alignment[0] and 28 x.dst_alignment==alignment[1]] 112 for alignment in alignments: 114 if plot(records, function, alignment, scale): 115 …pylab.savefig('sizes-%s-%02d-%02d-%.1f.png' % (function, alignment[0], alignment[1], scale), dpi=7…
|
/freebsd/sys/x86/x86/ |
H A D | busdma_machdep.c | 58 bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr, in common_bus_dma_tag_create() argument 84 common->alignment = alignment; in common_bus_dma_tag_create() 138 bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, in bus_dma_tag_create() argument 152 error = bus_dma_bounce_impl.tag_create(parent, alignment, in bus_dma_tag_create() 157 error = tc->impl->tag_create(parent, alignment, in bus_dma_tag_create() 174 t->alignment = common->alignment; in bus_dma_template_clone()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/tsan/rtl/ |
H A D | tsan_malloc_mac.cpp | 28 #define COMMON_MALLOC_MEMALIGN(alignment, size) \ argument 30 user_memalign(cur_thread(), StackTrace::GetCurrentPc(), alignment, size) 57 #define COMMON_MALLOC_POSIX_MEMALIGN(memptr, alignment, size) \ argument 59 void *p = InternalAlloc(size, nullptr, alignment); \ 64 SCOPED_INTERCEPTOR_RAW(posix_memalign, memptr, alignment, size); \ 65 int res = user_posix_memalign(thr, pc, memptr, alignment, size);
|
/freebsd/sys/contrib/ncsw/inc/etc/ |
H A D | mem_ext.h | 93 uint16_t alignment; /* Requested alignment for the data field */ member 129 uint16_t alignment); 155 uint16_t alignment, 181 uint16_t alignment, 259 uint16_t alignment); 307 #define MEM_GetAlignment(h_Mem) ((t_MemorySegment *)(h_Mem))->alignment
|