/netbsd-src/external/apache2/llvm/dist/libcxx/src/ |
H A D | new.cpp | 175 operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC in operator new() argument 179 if (static_cast<size_t>(alignment) < sizeof(void*)) in operator new() 180 alignment = std::align_val_t(sizeof(void*)); in operator new() 189 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) in operator new() 207 operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept in operator new() argument 214 p = ::operator new(size, alignment); in operator new() 226 operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC in operator new[]() argument 228 return ::operator new(size, alignment); in operator new[]() 233 operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept in operator new[]() argument 240 p = ::operator new[](size, alignment); in operator new[]() [all …]
|
/netbsd-src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/ |
H A D | sanitizer_allocator.cpp | 32 extern "C" void *__libc_memalign(uptr alignment, uptr size); 40 static void *__libc_memalign(uptr alignment, uptr size) { in __libc_memalign() argument 42 uptr error = posix_memalign(&p, alignment, size); in __libc_memalign() 52 uptr alignment) { in RawInternalAlloc() argument 55 if (alignment == 0) in RawInternalAlloc() 58 return __libc_memalign(alignment, size); in RawInternalAlloc() 65 DCHECK_EQ(alignment, 0); in RawInternalAlloc() 109 uptr alignment) { in RawInternalAlloc() argument 110 if (alignment == 0) alignment = 8; in RawInternalAlloc() 114 alignment); in RawInternalAlloc() [all …]
|
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_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 …]
|
/netbsd-src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/ |
H A D | sanitizer_allocator.cc | 31 extern "C" void *__libc_memalign(uptr alignment, uptr size); 39 static void *__libc_memalign(uptr alignment, uptr size) { in __libc_memalign() argument 41 uptr error = posix_memalign(&p, alignment, size); in __libc_memalign() 51 uptr alignment) { in RawInternalAlloc() argument 54 if (alignment == 0) in RawInternalAlloc() 57 return __libc_memalign(alignment, size); in RawInternalAlloc() 64 DCHECK_EQ(alignment, 0); in RawInternalAlloc() 108 uptr alignment) { in RawInternalAlloc() argument 109 if (alignment == 0) alignment = 8; in RawInternalAlloc() 113 alignment); in RawInternalAlloc() [all …]
|
H A D | sanitizer_allocator_checks.h | 43 INLINE bool CheckAlignedAllocAlignmentAndSize(uptr alignment, uptr size) { in CheckAlignedAllocAlignmentAndSize() argument 45 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckAlignedAllocAlignmentAndSize() 46 (size & (alignment - 1)) == 0; in CheckAlignedAllocAlignmentAndSize() 48 return alignment != 0 && size % alignment == 0; in CheckAlignedAllocAlignmentAndSize() 54 INLINE bool CheckPosixMemalignAlignment(uptr alignment) { in CheckPosixMemalignAlignment() argument 55 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckPosixMemalignAlignment() 56 (alignment % sizeof(void *)) == 0; // NOLINT in CheckPosixMemalignAlignment()
|
H A D | sanitizer_allocator_combined.h | 37 void *Allocate(AllocatorCache *cache, uptr size, uptr alignment) { in Allocate() argument 41 if (size + alignment < size) { in Allocate() 44 SanitizerToolName, size, alignment); in Allocate() 52 if (alignment > 8) in Allocate() 53 size = RoundUpTo(size, alignment); in Allocate() 61 if (primary_.CanAllocate(size, alignment)) in Allocate() 64 res = secondary_.Allocate(&stats_, original_size, alignment); in Allocate() 65 if (alignment > 8) in Allocate() 66 CHECK_EQ(reinterpret_cast<uptr>(res) & (alignment - 1), 0); in Allocate() 91 uptr alignment) { in Reallocate() argument [all …]
|
/netbsd-src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/ |
H A D | sanitizer_allocator.cc | 33 extern "C" void *__libc_memalign(uptr alignment, uptr size); 41 static void *__libc_memalign(uptr alignment, uptr size) { in __libc_memalign() argument 43 uptr error = posix_memalign(&p, alignment, size); in __libc_memalign() 53 uptr alignment) { in RawInternalAlloc() argument 56 if (alignment == 0) in RawInternalAlloc() 59 return __libc_memalign(alignment, size); in RawInternalAlloc() 66 DCHECK_EQ(alignment, 0); in RawInternalAlloc() 110 uptr alignment) { in RawInternalAlloc() argument 111 if (alignment == 0) alignment = 8; in RawInternalAlloc() 115 alignment); in RawInternalAlloc() [all …]
|
H A D | sanitizer_allocator_checks.h | 45 INLINE bool CheckAlignedAllocAlignmentAndSize(uptr alignment, uptr size) { in CheckAlignedAllocAlignmentAndSize() argument 47 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckAlignedAllocAlignmentAndSize() 48 (size & (alignment - 1)) == 0; in CheckAlignedAllocAlignmentAndSize() 50 return alignment != 0 && size % alignment == 0; in CheckAlignedAllocAlignmentAndSize() 56 INLINE bool CheckPosixMemalignAlignment(uptr alignment) { in CheckPosixMemalignAlignment() argument 57 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckPosixMemalignAlignment() 58 (alignment % sizeof(void *)) == 0; // NOLINT in CheckPosixMemalignAlignment()
|
H A D | sanitizer_allocator_combined.h | 48 void *Allocate(AllocatorCache *cache, uptr size, uptr alignment) { in Allocate() argument 52 if (size + alignment < size) { in Allocate() 55 SanitizerToolName, size, alignment); in Allocate() 63 if (alignment > 8) in Allocate() 64 size = RoundUpTo(size, alignment); in Allocate() 72 if (primary_.CanAllocate(size, alignment)) in Allocate() 75 res = secondary_.Allocate(&stats_, original_size, alignment); in Allocate() 76 if (alignment > 8) in Allocate() 77 CHECK_EQ(reinterpret_cast<uptr>(res) & (alignment - 1), 0); in Allocate() 102 uptr alignment) { in Reallocate() argument [all …]
|
/netbsd-src/sbin/gpt/ |
H A D | map.c | 203 map_alloc(gpt_t gpt, off_t start, off_t size, off_t alignment) in map_alloc() argument 208 if (alignment > 0) { in map_alloc() 209 if ((start % alignment) != 0) in map_alloc() 210 start = (start + alignment) / alignment * alignment; in map_alloc() 211 if ((size % alignment) != 0) in map_alloc() 212 size = (size + alignment) / alignment * alignment; in map_alloc() 223 else if (alignment > 0 && m->map_start % alignment != 0) in map_alloc() 224 delta = (m->map_start + alignment) / in map_alloc() 225 alignment * alignment - m->map_start; in map_alloc() 230 if (m->map_size - delta < alignment) in map_alloc() [all …]
|
/netbsd-src/external/bsd/jemalloc/dist/test/integration/ |
H A D | sdallocx.c | 13 size_t nsz, sz, alignment, total; in TEST_BEGIN() local 21 for (alignment = 8; in TEST_BEGIN() 22 alignment <= MAXALIGN; in TEST_BEGIN() 23 alignment <<= 1) { in TEST_BEGIN() 26 sz < 3 * alignment && sz < (1U << 31); in TEST_BEGIN() 27 sz += (alignment >> (LG_SIZEOF_PTR-1)) - 1) { in TEST_BEGIN() 29 nsz = nallocx(sz, MALLOCX_ALIGN(alignment) | in TEST_BEGIN() 31 ps[i] = mallocx(sz, MALLOCX_ALIGN(alignment) | in TEST_BEGIN() 41 MALLOCX_ALIGN(alignment)); in TEST_BEGIN()
|
/netbsd-src/external/apache2/llvm/dist/llvm/include/llvm/Support/ |
H A D | Endian.h | 35 template<class T, int alignment> 37 enum { value = alignment == 0 ? alignof(T) : alignment }; 62 template <typename value_type, std::size_t alignment> 68 memory, (detail::PickAlignment<value_type, alignment>::value)), in read() 75 std::size_t alignment> 77 return read<value_type, alignment>(memory, endian); in read() 82 template <typename value_type, std::size_t alignment, typename CharT> 84 value_type ret = read<value_type, alignment>(memory, endian); in readNext() 89 template<typename value_type, endianness endian, std::size_t alignment, 92 return readNext<value_type, alignment, CharT>(memory, endian); in readNext() [all …]
|
/netbsd-src/sys/uvm/ |
H A D | uvm_pglist.c | 113 paddr_t alignment, paddr_t boundary, struct pglist *rlist) in uvm_pglistalloc_c_ps() argument 141 alignment = atop(alignment); in uvm_pglistalloc_c_ps() 143 uvm_physseg_get_start_hint(psi)), alignment); in uvm_pglistalloc_c_ps() 166 candidate = roundup2(ulmax(low, uvm_physseg_get_avail_start(psi)), alignment); in uvm_pglistalloc_c_ps() 179 candidate = roundup2(candidate, alignment); in uvm_pglistalloc_c_ps() 205 __func__, psi, candidateidx, end, skip, alignment); in uvm_pglistalloc_c_ps() 264 cnt = roundup2(cnt, alignment); in uvm_pglistalloc_c_ps() 301 paddr_t alignment, paddr_t boundary, struct pglist *rlist) in uvm_pglistalloc_contig_aggressive() argument 318 acnt = atop(alignment); in uvm_pglistalloc_contig_aggressive() 319 amask = ~(alignment - 1); in uvm_pglistalloc_contig_aggressive() [all …]
|
/netbsd-src/lib/libc/stdlib/ |
H A D | aligned_alloc.c | 42 aligned_alloc(size_t alignment, size_t size) in aligned_alloc() 48 * Check that alignment is a power of 2. in aligned_alloc() 50 if (alignment == 0 || ((alignment - 1) & alignment) != 0) { in aligned_alloc() 56 * Adjust alignment to satisfy posix_memalign, in aligned_alloc() 59 while (alignment < sizeof(void *)) { in aligned_alloc() 60 alignment <<= 1; in aligned_alloc() 63 err = posix_memalign(&memptr, alignment, size); in aligned_alloc() 39 aligned_alloc(size_t alignment,size_t size) aligned_alloc() argument
|
/netbsd-src/external/gpl2/libmalloc/dist/ |
H A D | memalign.c | 28 memalign (alignment, size) in memalign() argument 29 __malloc_size_t alignment; in memalign() 36 return (*__memalign_hook) (alignment, size); 38 size = ((size + alignment - 1) / alignment) * alignment; 44 (char *) NULL)) % alignment; 64 result = l->aligned = (char *) result + alignment - adj;
|
/netbsd-src/sys/external/bsd/drm2/dist/drm/i915/ |
H A D | i915_gem_gtt.c | 220 u64 size, u64 alignment, unsigned long color, in i915_gem_gtt_insert() argument 231 GEM_BUG_ON(alignment && !is_power_of_2(alignment)); in i915_gem_gtt_insert() 232 GEM_BUG_ON(alignment && !IS_ALIGNED(alignment, I915_GTT_MIN_ALIGNMENT)); in i915_gem_gtt_insert() 242 if (unlikely(round_up(start, alignment) > round_down(end - size, alignment))) in i915_gem_gtt_insert() 258 if (alignment <= I915_GTT_MIN_ALIGNMENT) in i915_gem_gtt_insert() 259 alignment = 0; in i915_gem_gtt_insert() 262 size, alignment, color, in i915_gem_gtt_insert() 269 size, alignment, color, in i915_gem_gtt_insert() 303 size, alignment ?: I915_GTT_MIN_ALIGNMENT); in i915_gem_gtt_insert() 312 err = i915_gem_evict_something(vm, size, alignment, color, in i915_gem_gtt_insert() [all …]
|
/netbsd-src/external/gpl3/gcc/dist/libphobos/src/std/experimental/allocator/ |
H A D | common.d | 56 {enum x = Allocator.alignment;}); in hasStaticallyKnownAlignment() 91 return n.roundUpToMultipleOf(a.alignment); in goodAllocSize() 118 package size_t roundUpToAlignment(size_t n, uint alignment) in roundUpToAlignment() argument 121 assert(alignment.isPowerOf2); in roundUpToAlignment() 122 immutable uint slack = cast(uint) n & (alignment - 1); in roundUpToAlignment() 124 ? n + alignment - slack in roundUpToAlignment() 143 package size_t roundDownToAlignment(size_t n, uint alignment) in roundDownToAlignment() argument 146 assert(alignment.isPowerOf2); in roundDownToAlignment() 147 return n & ~size_t(alignment - 1); in roundDownToAlignment() 276 package bool alignedAt(T)(T* ptr, uint alignment) in alignedAt() [all …]
|
/netbsd-src/external/gpl3/gcc/dist/libsanitizer/hwasan/ |
H A D | hwasan_allocation_functions.cpp | 32 int __sanitizer_posix_memalign(void **memptr, uptr alignment, uptr size) { in __sanitizer_posix_memalign() argument 35 int res = hwasan_posix_memalign(memptr, alignment, size, &stack); in __sanitizer_posix_memalign() 40 void *__sanitizer_memalign(uptr alignment, uptr size) { in __sanitizer_memalign() argument 42 return hwasan_memalign(alignment, size, &stack); in __sanitizer_memalign() 46 void *__sanitizer_aligned_alloc(uptr alignment, uptr size) { in __sanitizer_aligned_alloc() argument 48 return hwasan_aligned_alloc(alignment, size, &stack); in __sanitizer_aligned_alloc() 52 void *__sanitizer___libc_memalign(uptr alignment, uptr size) { in __sanitizer___libc_memalign() argument 54 void *ptr = hwasan_memalign(alignment, size, &stack); in __sanitizer___libc_memalign() 153 INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment, 155 INTERCEPTOR_ALIAS(void *, aligned_alloc, SIZE_T alignment, SIZE_T size); [all …]
|
/netbsd-src/external/gpl3/binutils.old/dist/bfd/ |
H A D | merge.c | 45 unsigned int alignment; member 126 ret->alignment = 0; in sec_merge_hash_newfunc() 138 unsigned int alignment, bool create) in sec_merge_hash_lookup() argument 207 if (hashp->alignment < alignment) in sec_merge_hash_lookup() 213 hashp->alignment = 0; in sec_merge_hash_lookup() 229 hashp->alignment = alignment; in sec_merge_hash_lookup() 265 unsigned int alignment, struct sec_merge_sec_info *secinfo) in sec_merge_add() argument 269 entry = sec_merge_hash_lookup (tab, str, alignment, true); in sec_merge_add() 312 len = -off & (entry->alignment - 1); in sec_merge_emit() 600 int tail_align = (lenA & (A->alignment - 1)) - (lenB & (A->alignment - 1)); in strrevcmp_align() [all …]
|
/netbsd-src/sys/external/bsd/compiler_rt/dist/lib/lsan/ |
H A D | lsan_allocator.cc | 79 void *Allocate(const StackTrace &stack, uptr size, uptr alignment, in Allocate() argument 85 void *p = allocator.Allocate(GetAllocatorCache(), size, alignment); in Allocate() 119 uptr alignment) { in Reallocate() argument 125 p = allocator.Reallocate(GetAllocatorCache(), p, new_size, alignment); in Reallocate() 141 int lsan_posix_memalign(void **memptr, uptr alignment, uptr size, in lsan_posix_memalign() argument 143 if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) { in lsan_posix_memalign() 146 ReportInvalidPosixMemalignAlignment(alignment, &stack); in lsan_posix_memalign() 148 void *ptr = Allocate(stack, size, alignment, kAlwaysClearMemory); in lsan_posix_memalign() 152 CHECK(IsAligned((uptr)ptr, alignment)); in lsan_posix_memalign() 157 void *lsan_aligned_alloc(uptr alignment, uptr size, const StackTrace &stack) { in lsan_aligned_alloc() argument [all …]
|
/netbsd-src/external/gpl3/gcc.old/dist/libsanitizer/lsan/ |
H A D | lsan_allocator.cc | 82 void *Allocate(const StackTrace &stack, uptr size, uptr alignment, in Allocate() argument 88 void *p = allocator.Allocate(GetAllocatorCache(), size, alignment); in Allocate() 122 uptr alignment) { in Reallocate() argument 128 p = allocator.Reallocate(GetAllocatorCache(), p, new_size, alignment); in Reallocate() 144 int lsan_posix_memalign(void **memptr, uptr alignment, uptr size, in lsan_posix_memalign() argument 146 if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) { in lsan_posix_memalign() 149 ReportInvalidPosixMemalignAlignment(alignment, &stack); in lsan_posix_memalign() 151 void *ptr = Allocate(stack, size, alignment, kAlwaysClearMemory); in lsan_posix_memalign() 155 CHECK(IsAligned((uptr)ptr, alignment)); in lsan_posix_memalign() 160 void *lsan_aligned_alloc(uptr alignment, uptr size, const StackTrace &stack) { in lsan_aligned_alloc() argument [all …]
|
/netbsd-src/external/gpl3/gcc/dist/libsanitizer/lsan/ |
H A D | lsan_allocator.cpp | 85 void *Allocate(const StackTrace &stack, uptr size, uptr alignment, in Allocate() argument 91 void *p = allocator.Allocate(GetAllocatorCache(), size, alignment); in Allocate() 125 uptr alignment) { in Reallocate() argument 132 allocator.Reallocate(GetAllocatorCache(), p, new_size, alignment); in Reallocate() 151 int lsan_posix_memalign(void **memptr, uptr alignment, uptr size, in lsan_posix_memalign() argument 153 if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) { in lsan_posix_memalign() 156 ReportInvalidPosixMemalignAlignment(alignment, &stack); in lsan_posix_memalign() 158 void *ptr = Allocate(stack, size, alignment, kAlwaysClearMemory); in lsan_posix_memalign() 162 CHECK(IsAligned((uptr)ptr, alignment)); in lsan_posix_memalign() 167 void *lsan_aligned_alloc(uptr alignment, uptr size, const StackTrace &stack) { in lsan_aligned_alloc() argument [all …]
|
/netbsd-src/external/gpl3/gcc.old/dist/libsanitizer/asan/ |
H A D | asan_malloc_linux.cc | 63 static int PosixMemalignFromLocalPool(void **memptr, uptr alignment, in PosixMemalignFromLocalPool() argument 65 if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) in PosixMemalignFromLocalPool() 68 CHECK(alignment >= kWordSize); in PosixMemalignFromLocalPool() 71 uptr aligned_addr = RoundUpTo(addr, alignment); in PosixMemalignFromLocalPool() 85 void* MemalignFromLocalPool(uptr alignment, uptr size) { in MemalignFromLocalPool() argument 87 alignment = Max(alignment, kWordSize); in MemalignFromLocalPool() 88 PosixMemalignFromLocalPool(&ptr, alignment, size); in MemalignFromLocalPool() 214 INTERCEPTOR(int, posix_memalign, void **memptr, uptr alignment, uptr size) { in INTERCEPTOR() argument 216 return PosixMemalignFromLocalPool(memptr, alignment, size); in INTERCEPTOR() 218 return asan_posix_memalign(memptr, alignment, size, &stack); in INTERCEPTOR() [all …]
|
/netbsd-src/sys/external/bsd/compiler_rt/dist/lib/asan/ |
H A D | asan_malloc_linux.cc | 65 static int PosixMemalignFromLocalPool(void **memptr, uptr alignment, in PosixMemalignFromLocalPool() argument 67 if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) in PosixMemalignFromLocalPool() 70 CHECK(alignment >= kWordSize); in PosixMemalignFromLocalPool() 73 uptr aligned_addr = RoundUpTo(addr, alignment); in PosixMemalignFromLocalPool() 87 void* MemalignFromLocalPool(uptr alignment, uptr size) { in MemalignFromLocalPool() argument 89 alignment = Max(alignment, kWordSize); in MemalignFromLocalPool() 90 PosixMemalignFromLocalPool(&ptr, alignment, size); in MemalignFromLocalPool() 216 INTERCEPTOR(int, posix_memalign, void **memptr, uptr alignment, uptr size) { in INTERCEPTOR() argument 218 return PosixMemalignFromLocalPool(memptr, alignment, size); in INTERCEPTOR() 220 return asan_posix_memalign(memptr, alignment, size, &stack); in INTERCEPTOR() [all …]
|