Home
last modified time | relevance | path

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

12345678910>>...24

/src/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 …]
/src/contrib/llvm-project/libcxx/src/
H A Dnew.cpp119 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 …]
/src/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 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 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()
/src/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) \ 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
/src/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.c47 size_t alignment = HUGEPAGE; in base_map() local
49 addr = extent_alloc_mmap(NULL, size, alignment, &zero, &commit); in base_map()
54 addr = ehooks_alloc(tsdn, ehooks, NULL, size, alignment, &zero, in base_map()
176 size_t alignment) { in base_extent_bump_alloc_helper() argument
179 assert(alignment == ALIGNMENT_CEILING(alignment, QUANTUM)); in base_extent_bump_alloc_helper()
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() argument
232 ret = base_extent_bump_alloc_helper(edata, &gap_size, size, alignment); in base_extent_bump_alloc()
245 size_t alignment) { in base_block_alloc() argument
[all …]
H A Dehooks.c23 size_t alignment, bool *zero, bool *commit, dss_prec_t dss_prec) { in extent_alloc_core() argument
27 assert(alignment != 0); in extent_alloc_core()
31 extent_alloc_dss(tsdn, arena, new_addr, size, alignment, zero, in extent_alloc_core()
36 if ((ret = extent_alloc_mmap(new_addr, size, alignment, zero, commit)) in extent_alloc_core()
42 extent_alloc_dss(tsdn, arena, new_addr, size, alignment, zero, in extent_alloc_core()
53 size_t alignment, bool *zero, bool *commit, unsigned arena_ind) { in ehooks_default_alloc_impl() argument
56 assert(arena != NULL || alignment == HUGEPAGE); in ehooks_default_alloc_impl()
59 void *ret = extent_alloc_core(tsdn, arena, new_addr, size, alignment, in ehooks_default_alloc_impl()
69 size_t alignment, bool *zero, bool *commit, unsigned arena_ind) { in ehooks_default_alloc() argument
71 ALIGNMENT_CEILING(alignment, PAGE), zero, commit, arena_ind); in ehooks_default_alloc()
/src/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 …]
/src/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() argument
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() argument
91 return ipallocztm(tsdn, usize, alignment, zero, tcache, false, arena); in ipalloct()
95 ipalloc(tsd_t *tsd, size_t usize, size_t alignment, bool zero) { in ipalloc() argument
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() argument
145 usize = sz_sa2u(size, alignment); in iralloct_realign()
[all …]
H A Djemalloc_internal_types.h101 #define ALIGNMENT_ADDR2BASE(a, alignment) \ argument
102 ((void *)((uintptr_t)(a) & ((~(alignment)) + 1)))
105 #define ALIGNMENT_ADDR2OFFSET(a, alignment) \ argument
106 ((size_t)((uintptr_t)(a) & (alignment - 1)))
109 #define ALIGNMENT_CEILING(s, alignment) \ argument
110 (((s) + (alignment - 1)) & ((~(alignment)) + 1))
/src/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 …]
/src/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()
/src/contrib/llvm-project/compiler-rt/lib/dfsan/
H A Ddfsan_allocator.cpp91 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 …]
/src/contrib/llvm-project/compiler-rt/lib/hwasan/
H A Dhwasan_allocation_functions.cpp43 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 …]
/src/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()
/src/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()
/src/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 …]
/src/contrib/llvm-project/compiler-rt/lib/msan/
H A Dmsan_allocator.cpp184 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 …]
/src/sys/riscv/riscv/
H A Dbusdma_machdep.c53 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()
/src/sys/x86/x86/
H A Dbusdma_machdep.c58 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()
/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/
H A Dtsan_malloc_mac.cpp28 #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);

12345678910>>...24