Home
last modified time | relevance | path

Searched refs:alignment (Results 1 – 25 of 598) sorted by relevance

12345678910>>...24

/freebsd/sys/dev/drm2/
H A Ddrm_mm.h105 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 Ddrm_mm.c116 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 Dnew.cpp117 static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignment) { in operator_new_aligned_impl() argument
120 if (static_cast<size_t>(alignment) < sizeof(void*)) in operator_new_aligned_impl()
121 alignment = std::align_val_t(sizeof(void*)); in operator_new_aligned_impl()
127 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) { in operator_new_aligned_impl()
137 _LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new, (std::size_t size, std::align_val_t alignment)) _…
138 void* p = operator_new_aligned_impl(size, alignment);
144 _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noe… in operator new() argument
157 return operator_new_aligned_impl(size, alignment); in operator new()
161 p = ::operator new(size, alignment); in operator new()
168 _LIBCPP_OVERRIDABLE_FUNCTION(void*, operator new[], (size_t size, std::align_val_t alignment)) _THR…
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/
H A Dsanitizer_allocator_checks.h44 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 Dsanitizer_allocator.cpp50 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 constexpr usize alignment = Max<usize>(8, sizeof(void *)); 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()
168 void SetLowLevelAllocateMinAlignment(uptr alignment) { in SetLowLevelAllocateMinAlignment() argument
[all …]
H A Dsanitizer_allocator_combined.h44 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 Dsanitizer_allocator_report.cpp76 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 Djemalloc_internal_inlines_c.h69 ipallocztm(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero, in ipallocztm()
74 assert(usize == sz_sa2u(usize, alignment)); in ipallocztm()
80 ret = arena_palloc(tsdn, arena, usize, alignment, zero, tcache); in ipallocztm()
81 assert(ALIGNMENT_ADDR2BASE(ret, alignment) == ret); in ipallocztm()
89 ipalloct(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero, in ipalloct()
91 return ipallocztm(tsdn, usize, alignment, zero, tcache, false, arena);
95 ipalloc(tsd_t *tsd, size_t usize, size_t alignment, bool zero) { in ipalloc()
96 return ipallocztm(tsd_tsdn(tsd), usize, alignment, zero, in ipalloc()
138 size_t alignment, bool zero, tcache_t *tcache, arena_t *arena, in iralloct_realign()
145 usize = sz_sa2u(size, alignment); in iralloct_realign()
67 ipallocztm(tsdn_t * tsdn,size_t usize,size_t alignment,bool zero,tcache_t * tcache,bool is_internal,arena_t * arena) ipallocztm() argument
87 ipalloct(tsdn_t * tsdn,size_t usize,size_t alignment,bool zero,tcache_t * tcache,arena_t * arena) ipalloct() argument
93 ipalloc(tsd_t * tsd,size_t usize,size_t alignment,bool zero) ipalloc() argument
136 iralloct_realign(tsdn_t * tsdn,void * ptr,size_t oldsize,size_t size,size_t alignment,bool zero,tcache_t * tcache,arena_t * arena,hook_ralloc_args_t * hook_args) iralloct_realign() argument
174 iralloct(tsdn_t * tsdn,void * ptr,size_t oldsize,size_t size,size_t alignment,bool zero,tcache_t * tcache,arena_t * arena,hook_ralloc_args_t * hook_args) iralloct() argument
197 iralloc(tsd_t * tsd,void * ptr,size_t oldsize,size_t size,size_t alignment,bool zero,hook_ralloc_args_t * hook_args) iralloc() argument
205 ixalloc(tsdn_t * tsdn,void * ptr,size_t oldsize,size_t size,size_t extra,size_t alignment,bool zero,size_t * newsize) ixalloc() argument
[all...]
H A Djemalloc_internal_types.h38 * n: alignment
55 /* Use MALLOCX_ALIGN_GET() if alignment may not be specified in flags. */
101 #define ALIGNMENT_ADDR2BASE(a, alignment) \
102 ((void *)((uintptr_t)(a) & ((~(alignment)) + 1)))
105 #define ALIGNMENT_ADDR2OFFSET(a, alignment) \
106 ((size_t)((uintptr_t)(a) & (alignment - 1)))
108 /* Return the smallest alignment multiple that is >= s. */
109 #define ALIGNMENT_CEILING(s, alignment) \
110 (((s) + (alignment - 1)) & ((~(alignment))
85 ALIGNMENT_ADDR2BASE(a,alignment) global() argument
89 ALIGNMENT_ADDR2OFFSET(a,alignment) global() argument
93 ALIGNMENT_CEILING(s,alignment) global() argument
[all...]
/freebsd/contrib/jemalloc/src/
H A Djemalloc_cpp.cpp137 alignedNewImpl(std::size_t size, std::align_val_t alignment) noexcept(IsNoExcept) { in alignedNewImpl() argument
138 void *ptr = je_aligned_alloc(static_cast<std::size_t>(alignment), size); in alignedNewImpl()
147 operator new(std::size_t size, std::align_val_t alignment) { in operator new() argument
148 return alignedNewImpl<false>(size, alignment); in operator new()
152 operator new[](std::size_t size, std::align_val_t alignment) { in operator new[]() argument
153 return alignedNewImpl<false>(size, alignment); in operator new[]()
157 operator new(std::size_t size, std::align_val_t alignment, const std::nothrow_t &) noexcept { in operator new() argument
158 return alignedNewImpl<true>(size, alignment); in operator new()
162 operator new[](std::size_t size, std::align_val_t alignment, const std::nothrow_t &) noexcept { in operator new[]() argument
163 return alignedNewImpl<true>(size, alignment); in operator new[]()
[all …]
H A Dbase.c45 /* Use huge page sizes and alignment regardless of opt_metadata_thp. */ in base_map()
47 size_t alignment = HUGEPAGE; in base_map()
49 addr = extent_alloc_mmap(NULL, size, alignment, &zero, &commit); in base_map()
54 addr = ehooks_alloc(tsdn, ehooks, NULL, size, alignment, &zero,
176 size_t alignment) { in base_auto_thp_switch()
179 assert(alignment == ALIGNMENT_CEILING(alignment, QUANTUM));
180 assert(size == ALIGNMENT_CEILING(size, alignment)); in base_extent_bump_alloc_helper()
183 alignment) - (uintptr_t)edata_addr_get(edata); in base_extent_bump_alloc_helper()
228 size_t alignment) { in base_extent_bump_alloc_post()
39 size_t alignment = HUGEPAGE; base_map() local
181 base_extent_bump_alloc_helper(extent_t * extent,size_t * gap_size,size_t size,size_t alignment) base_extent_bump_alloc_helper() argument
233 base_extent_bump_alloc(base_t * base,extent_t * extent,size_t size,size_t alignment) base_extent_bump_alloc() argument
250 base_block_alloc(tsdn_t * tsdn,base_t * base,extent_hooks_t * extent_hooks,unsigned ind,pszind_t * pind_last,size_t * extent_sn_next,size_t size,size_t alignment) base_block_alloc() argument
308 base_extent_alloc(tsdn_t * tsdn,base_t * base,size_t size,size_t alignment) base_extent_alloc() argument
421 base_alloc_impl(tsdn_t * tsdn,base_t * base,size_t size,size_t alignment,size_t * esn) base_alloc_impl() argument
464 base_alloc(tsdn_t * tsdn,base_t * base,size_t size,size_t alignment) base_alloc() argument
[all...]
/freebsd/sys/contrib/ncsw/etc/
H A Dncsw_mem.c48 #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/libc/src/__support/
H A Dblock.h28 LIBC_INLINE constexpr size_t align_down(size_t value, size_t alignment) { in align_down() argument
30 return (value / alignment) * alignment; in align_down()
35 LIBC_INLINE constexpr size_t align_up(size_t value, size_t alignment) { in align_up() argument
36 return align_down(value + alignment - 1, alignment); in align_up()
243 LIBC_INLINE bool is_usable_space_aligned(size_t alignment) const { in is_usable_space_aligned() argument
244 return reinterpret_cast<uintptr_t>(usable_space()) % alignment == 0; in is_usable_space_aligned()
251 LIBC_INLINE static size_t min_size_for_allocation(size_t alignment, in min_size_for_allocation() argument
253 LIBC_ASSERT(alignment >= alignof(max_align_t) && in min_size_for_allocation()
254 alignment % alignof(max_align_t) == 0 && in min_size_for_allocation()
257 if (alignment == alignof(max_align_t)) in min_size_for_allocation()
[all …]
H A Dfreelist_heap.h42 void *aligned_allocate(size_t alignment, size_t size);
54 void *allocate_impl(size_t alignment, size_t size);
85 LIBC_INLINE void *FreeListHeap::allocate_impl(size_t alignment, size_t size) { in allocate_impl() argument
92 size_t request_size = Block::min_size_for_allocation(alignment, size); in allocate_impl()
100 auto block_info = Block::allocate(block, alignment, size); in allocate_impl()
114 LIBC_INLINE void *FreeListHeap::aligned_allocate(size_t alignment, in aligned_allocate() argument
117 if (!IsPow2(alignment)) in aligned_allocate()
121 if (size % alignment != 0) in aligned_allocate()
125 alignment = cpp::max(alignment, alignof(max_align_t)); in aligned_allocate()
127 return allocate_impl(alignment, size); in aligned_allocate()
/freebsd/sys/dev/qat/qat_api/qat_utils/src/
H A DQatUtilsServices.c44 qatUtilsMemAllocContiguousNUMA(uint32_t size, uint32_t node, uint32_t alignment) in qatUtilsMemAllocContiguousNUMA() argument
51 if (size == 0 || alignment < 1) { in qatUtilsMemAllocContiguousNUMA()
56 if (alignment & (alignment - 1)) { 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 - alignment_offset); in qatUtilsMemAllocContiguousNUMA()
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/
H A DEndian.h34 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/clang/lib/CIR/CodeGen/
H A DAddress.h37 clang::CharUnits alignment; variable
44 clang::CharUnits alignment) in Address() argument
46 alignment(alignment) { in Address()
52 assert(!alignment.isZero() && "Alignment cannot be zero"); in Address()
58 Address(mlir::Value pointer, clang::CharUnits alignment) in Address() argument
61 alignment) { in Address()
62 assert((!alignment.isZero() || pointer == nullptr) && in Address()
103 clang::CharUnits getAlignment() const { return alignment; } in getAlignment()
/freebsd/contrib/llvm-project/compiler-rt/lib/hwasan/
H A Dhwasan_allocation_functions.cpp42 int __sanitizer_posix_memalign(void **memptr, uptr alignment, uptr size) { in __sanitizer_posix_memalign() argument
45 int res = hwasan_posix_memalign(memptr, alignment, size, &stack); in __sanitizer_posix_memalign()
50 void *__sanitizer_memalign(uptr alignment, uptr size) { in __sanitizer_memalign() argument
52 return hwasan_memalign(alignment, size, &stack); in __sanitizer_memalign()
56 void *__sanitizer_aligned_alloc(uptr alignment, uptr size) { in __sanitizer_aligned_alloc() argument
58 return hwasan_aligned_alloc(alignment, size, &stack); in __sanitizer_aligned_alloc()
62 void *__sanitizer___libc_memalign(uptr alignment, uptr size) { in __sanitizer___libc_memalign() argument
64 return hwasan_memalign(alignment, size, &stack); in __sanitizer___libc_memalign()
167 INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment,
169 INTERCEPTOR_ALIAS(void *, aligned_alloc, SIZE_T alignment, SIZE_T size);
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/dfsan/
H A Ddfsan_allocator.cpp94 static void *DFsanAllocate(uptr size, uptr alignment, bool zeroise) { in DFsanAllocate() argument
114 allocated = allocator.Allocate(cache, size, alignment); in DFsanAllocate()
118 allocated = allocator.Allocate(cache, size, alignment); in DFsanAllocate()
157 static void *DFsanReallocate(void *old_p, uptr new_size, uptr alignment) { in DFsanReallocate() argument
169 void *new_p = DFsanAllocate(new_size, alignment, false /*zeroise*/); in DFsanReallocate()
263 void *__dfsan::dfsan_aligned_alloc(uptr alignment, uptr size) { in dfsan_aligned_alloc() argument
264 if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(alignment, size))) { in dfsan_aligned_alloc()
269 ReportInvalidAlignedAllocAlignment(size, alignment, &stack); in dfsan_aligned_alloc()
271 return SetErrnoOnNull(DFsanAllocate(size, alignment, false /*zeroise*/)); in dfsan_aligned_alloc()
274 void *__dfsan::dfsan_memalign(uptr alignment, uptr size) { in dfsan_memalign() argument
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/nsan/
H A Dnsan_allocator.cpp91 static void *NsanAllocate(uptr size, uptr alignment, bool zero) { in NsanAllocate() argument
114 allocated = allocator.Allocate(cache, size, alignment); in NsanAllocate()
118 allocated = allocator.Allocate(cache, size, alignment); in NsanAllocate()
157 static void *NsanReallocate(void *ptr, uptr new_size, uptr alignment) { in NsanReallocate() argument
168 void *new_p = NsanAllocate(new_size, alignment, false); in NsanReallocate()
265 void *__nsan::nsan_aligned_alloc(uptr alignment, uptr size) { in nsan_aligned_alloc() argument
266 if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(alignment, size))) { in nsan_aligned_alloc()
272 ReportInvalidAlignedAllocAlignment(size, alignment, &stack); in nsan_aligned_alloc()
274 return SetErrnoOnNull(NsanAllocate(size, alignment, false)); in nsan_aligned_alloc()
277 void *__nsan::nsan_memalign(uptr alignment, uptr size) { in nsan_memalign() argument
[all …]
/freebsd/sys/arm64/arm64/
H A Dbusdma_machdep.c54 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 Dkmp_barrier.h21 #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 Dstride_dd.c25 static int alignment = 0; variable
87 invalid_alignment(int alignment) in invalid_alignment() argument
89 if ((alignment < 0) || (alignment & (alignment - 1)) || in invalid_alignment()
90 ((alignment % sizeof (void *)))) { in invalid_alignment()
106 alignment = sysconf(_SC_PAGE_SIZE); in parse_options()
114 alignment = atoi(optarg); in parse_options()
185 seek < 0 || invalid_alignment(alignment) || skip < 0) { in parse_options()
310 int err = posix_memalign(&buf, alignment, bsize); in main()
/freebsd/contrib/llvm-project/compiler-rt/lib/lsan/
H A Dlsan_allocator.cpp90 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 …]
H A Dlsan_malloc_mac.cpp27 #define COMMON_MALLOC_MEMALIGN(alignment, size) \ argument
29 void *p = lsan_memalign(alignment, size, stack)
39 #define COMMON_MALLOC_POSIX_MEMALIGN(memptr, alignment, size) \ argument
41 int res = lsan_posix_memalign(memptr, alignment, size, stack)
48 # define COMMON_MALLOC_FREE_ALIGNED_SIZED(ptr, alignment, size) \ argument
49 lsan_free_aligned_sized(ptr, alignment, size)

12345678910>>...24