/third_party/python/Lib/lib2to3/tests/data/ |
D | infinite_recursion.py | 41 assert alignment(__mbstate_t) == 4, alignment(__mbstate_t) 77 assert alignment(sigcontext) == 4, alignment(sigcontext) 101 assert alignment(aes_key_st) == 4, alignment(aes_key_st) 119 assert alignment(asn1_ctx_st) == 4, alignment(asn1_ctx_st) 132 assert alignment(asn1_object_st) == 4, alignment(asn1_object_st) 143 assert alignment(asn1_string_st) == 4, alignment(asn1_string_st) 153 assert alignment(ASN1_ENCODING_st) == 4, alignment(ASN1_ENCODING_st) 165 assert alignment(asn1_string_table_st) == 4, alignment(asn1_string_table_st) 230 assert alignment(N12asn1_type_st4DOLLAR_11E) == 4, alignment(N12asn1_type_st4DOLLAR_11E) 236 assert alignment(asn1_type_st) == 4, alignment(asn1_type_st) [all …]
|
/third_party/boost/libs/align/test/ |
D | aligned_alloc_test.cpp | 13 void test(std::size_t alignment) in test() argument 16 void* p = boost::alignment::aligned_alloc(alignment, alignment + 1); in test() 18 BOOST_TEST(boost::alignment::is_aligned(p, alignment)); in test() 19 std::memset(p, 0, alignment); in test() 20 boost::alignment::aligned_free(p); in test() 23 void* p = boost::alignment::aligned_alloc(alignment, 1); in test() 25 BOOST_TEST(boost::alignment::is_aligned(p, alignment)); in test() 27 boost::alignment::aligned_free(p); in test() 30 void* p = boost::alignment::aligned_alloc(alignment, 0); in test() 31 boost::alignment::aligned_free(p); in test()
|
D | aligned_allocator_test.cpp | 17 boost::alignment::aligned_allocator<int, Alignment> a; in test_allocate() 20 BOOST_TEST(boost::alignment::is_aligned(p, Alignment)); in test_allocate() 25 boost::alignment::aligned_allocator<int, Alignment> a; in test_allocate() 34 boost::alignment::aligned_allocator<int, Alignment> a; in test_construct() 46 boost::alignment::aligned_allocator<char, Alignment> a1; in test_constructor() 47 boost::alignment::aligned_allocator<int, Alignment> a2(a1); in test_constructor() 51 boost::alignment::aligned_allocator<char, Alignment> a1; in test_constructor() 52 boost::alignment::aligned_allocator<void, Alignment> a2(a1); in test_constructor() 56 boost::alignment::aligned_allocator<void, Alignment> a1; in test_constructor() 57 boost::alignment::aligned_allocator<char, Alignment> a2(a1); in test_constructor() [all …]
|
/third_party/flutter/skia/third_party/externals/dawn/src/common/ |
D | Math.cpp | 55 bool IsPtrAligned(const void* ptr, size_t alignment) { in IsPtrAligned() argument 56 ASSERT(IsPowerOfTwo(alignment)); in IsPtrAligned() 57 ASSERT(alignment != 0); in IsPtrAligned() 58 return (reinterpret_cast<size_t>(ptr) & (alignment - 1)) == 0; in IsPtrAligned() 61 void* AlignVoidPtr(void* ptr, size_t alignment) { in AlignVoidPtr() argument 62 ASSERT(IsPowerOfTwo(alignment)); in AlignVoidPtr() 63 ASSERT(alignment != 0); in AlignVoidPtr() 64 return reinterpret_cast<void*>((reinterpret_cast<size_t>(ptr) + (alignment - 1)) & in AlignVoidPtr() 65 ~(alignment - 1)); in AlignVoidPtr() 68 bool IsAligned(uint32_t value, size_t alignment) { in IsAligned() argument [all …]
|
/third_party/flutter/skia/tests/ |
D | SkSLMemoryLayoutTest.cpp | 35 REPORTER_ASSERT(r, 4 == layout.alignment(*context.fFloat_Type)); in DEF_TEST() 36 REPORTER_ASSERT(r, 8 == layout.alignment(*context.fFloat2_Type)); in DEF_TEST() 37 REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat3_Type)); in DEF_TEST() 38 REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat4_Type)); in DEF_TEST() 39 REPORTER_ASSERT(r, 4 == layout.alignment(*context.fInt_Type)); in DEF_TEST() 40 REPORTER_ASSERT(r, 8 == layout.alignment(*context.fInt2_Type)); in DEF_TEST() 41 REPORTER_ASSERT(r, 16 == layout.alignment(*context.fInt3_Type)); in DEF_TEST() 42 REPORTER_ASSERT(r, 16 == layout.alignment(*context.fInt4_Type)); in DEF_TEST() 43 REPORTER_ASSERT(r, 1 == layout.alignment(*context.fBool_Type)); in DEF_TEST() 44 REPORTER_ASSERT(r, 2 == layout.alignment(*context.fBool2_Type)); in DEF_TEST() [all …]
|
D | MemsetTest.cpp | 51 for (int alignment = 0; alignment < MAX_ALIGNMENT; ++alignment) { in test_16() local 54 uint16_t* base = &buffer[PAD + alignment]; in test_16() 57 compare16(reporter, buffer, 0, PAD + alignment); in test_16() 59 compare16(reporter, base + count, 0, TOTAL - count - PAD - alignment); in test_16() 68 for (int alignment = 0; alignment < MAX_ALIGNMENT; ++alignment) { in test_32() local 71 uint32_t* base = &buffer[PAD + alignment]; in test_32() 74 compare32(reporter, buffer, 0, PAD + alignment); in test_32() 76 compare32(reporter, base + count, 0, TOTAL - count - PAD - alignment); in test_32()
|
/third_party/skia/third_party/externals/dawn/src/common/ |
D | Math.h | 51 bool IsPtrAligned(const void* ptr, size_t alignment); 52 void* AlignVoidPtr(void* ptr, size_t alignment); 53 bool IsAligned(uint32_t value, size_t alignment); 56 T Align(T value, size_t alignment) { in Align() argument 57 ASSERT(value <= std::numeric_limits<T>::max() - (alignment - 1)); in Align() 58 ASSERT(IsPowerOfTwo(alignment)); in Align() 59 ASSERT(alignment != 0); in Align() 60 T alignmentT = static_cast<T>(alignment); in Align() 65 DAWN_FORCE_INLINE T* AlignPtr(T* ptr, size_t alignment) { in AlignPtr() argument 66 ASSERT(IsPowerOfTwo(alignment)); in AlignPtr() [all …]
|
/third_party/flutter/skia/src/sksl/ |
D | SkSLMemoryLayout.h | 47 size_t alignment(const Type& type) const { in alignment() function 58 return this->roundUpIfNeeded(this->alignment(type.componentType())); in alignment() 62 size_t alignment = this->alignment(*f.fType); in alignment() local 63 if (alignment > result) { in alignment() 64 result = alignment; in alignment() 85 int align = this->alignment(type.componentType()); in stride() 118 size_t alignment = this->alignment(*f.fType); in size() local 119 if (total % alignment != 0) { in size() 120 total += alignment - total % alignment; in size() 122 SkASSERT(total % alignment == 0); in size() [all …]
|
/third_party/skia/tests/ |
D | SkSLMemoryLayoutTest.cpp | 40 REPORTER_ASSERT(r, 4 == layout.alignment(*context.fTypes.fFloat)); in DEF_TEST() 41 REPORTER_ASSERT(r, 8 == layout.alignment(*context.fTypes.fFloat2)); in DEF_TEST() 42 REPORTER_ASSERT(r, 16 == layout.alignment(*context.fTypes.fFloat3)); in DEF_TEST() 43 REPORTER_ASSERT(r, 16 == layout.alignment(*context.fTypes.fFloat4)); in DEF_TEST() 44 REPORTER_ASSERT(r, 4 == layout.alignment(*context.fTypes.fInt)); in DEF_TEST() 45 REPORTER_ASSERT(r, 8 == layout.alignment(*context.fTypes.fInt2)); in DEF_TEST() 46 REPORTER_ASSERT(r, 16 == layout.alignment(*context.fTypes.fInt3)); in DEF_TEST() 47 REPORTER_ASSERT(r, 16 == layout.alignment(*context.fTypes.fInt4)); in DEF_TEST() 48 REPORTER_ASSERT(r, 1 == layout.alignment(*context.fTypes.fBool)); in DEF_TEST() 49 REPORTER_ASSERT(r, 2 == layout.alignment(*context.fTypes.fBool2)); in DEF_TEST() [all …]
|
D | MemsetTest.cpp | 51 for (int alignment = 0; alignment < MAX_ALIGNMENT; ++alignment) { in test_16() local 54 uint16_t* base = &buffer[PAD + alignment]; in test_16() 57 compare16(reporter, buffer, 0, PAD + alignment); in test_16() 59 compare16(reporter, base + count, 0, TOTAL - count - PAD - alignment); in test_16() 68 for (int alignment = 0; alignment < MAX_ALIGNMENT; ++alignment) { in test_32() local 71 uint32_t* base = &buffer[PAD + alignment]; in test_32() 74 compare32(reporter, buffer, 0, PAD + alignment); in test_32() 76 compare32(reporter, base + count, 0, TOTAL - count - PAD - alignment); in test_32()
|
/third_party/skia/src/sksl/ |
D | SkSLMemoryLayout.h | 49 size_t alignment(const Type& type) const { in alignment() function 60 return this->roundUpIfNeeded(this->alignment(type.componentType())); in alignment() 64 size_t alignment = this->alignment(*f.fType); in alignment() local 65 if (alignment > result) { in alignment() 66 result = alignment; in alignment() 89 int align = this->alignment(type.componentType()); in stride() 125 size_t alignment = this->alignment(*f.fType); in size() local 126 if (total % alignment != 0) { in size() 127 total += alignment - total % alignment; in size() 129 SkASSERT(total % alignment == 0); in size() [all …]
|
/third_party/musl/ndk-test/sanitize/scudo/src/ |
D | memalign.c | 21 void *aligned_alloc(size_t alignment, size_t size); 25 size_t alignment = 1U << 12; in main() local 32 posix_memalign(&p, alignment, size); in main() 34 assert(((uintptr_t)p & (alignment - 1)) == 0); in main() 36 p = aligned_alloc(alignment, size); in main() 38 assert(((uintptr_t)p & (alignment - 1)) == 0); in main() 42 alignment = 1U << i; in main() 46 p = memalign(alignment, size - (2 * sizeof(void *) * k)); in main() 48 assert(((uintptr_t)p & (alignment - 1)) == 0); in main() 56 alignment = 1U << i; in main() [all …]
|
/third_party/python/Modules/_ctypes/libffi_osx/ |
D | ffi.c | 44 arg->size != 0 || arg->alignment != 0) in initialize_aggregate() 58 int curalign = (*ptr)->alignment; in initialize_aggregate() 68 arg->alignment = (arg->alignment > curalign) ? in initialize_aggregate() 69 arg->alignment : curalign; in initialize_aggregate() 71 arg->size = ALIGN(arg->size, (*ptr)->alignment); in initialize_aggregate() 73 arg->alignment = (arg->alignment > (*ptr)->alignment) ? in initialize_aggregate() 74 arg->alignment : (*ptr)->alignment; in initialize_aggregate() 87 arg->size = ALIGN(arg->size, arg->alignment); in initialize_aggregate() 184 if ((*ptr)->alignment == 0) in ffi_prep_cif() 193 int align = (*ptr)->alignment; in ffi_prep_cif() [all …]
|
/third_party/boost/libs/align/doc/ |
D | align.qbk | 20 and macros, for the control, inspection, and diagnostic of memory alignment. 28 C++11 added the ability to specify increased alignment (over-alignment) for 32 allocation functions and allocators that respect the alignment requirements of 36 [[`aligned_alloc(alignment, size)`] 44 [heading Pointer alignment] 53 [heading Querying alignment] 56 the alignment requirement of a type. Unfortunately some C++ standard library 63 [heading Hinting alignment] 67 compiler of a given alignment property of a memory block. This library 71 [heading Checking alignment] [all …]
|
/third_party/skia/third_party/externals/angle2/src/common/ |
D | aligned_memory.cpp | 23 void *AlignedAlloc(size_t size, size_t alignment) in AlignedAlloc() argument 26 ASSERT((alignment & (alignment - 1)) == 0); in AlignedAlloc() 27 ASSERT((alignment % sizeof(void *)) == 0); in AlignedAlloc() 30 ptr = _aligned_malloc(size, alignment); in AlignedAlloc() 37 ptr = memalign(alignment, size); in AlignedAlloc() 39 if (posix_memalign(&ptr, alignment, size)) in AlignedAlloc() 47 << "size=" << size << ", alignment=" << alignment; in AlignedAlloc() 51 ASSERT((reinterpret_cast<uintptr_t>(ptr) & (alignment - 1)) == 0); in AlignedAlloc()
|
/third_party/flutter/skia/third_party/externals/angle2/src/common/ |
D | aligned_memory.cpp | 23 void *AlignedAlloc(size_t size, size_t alignment) in AlignedAlloc() argument 26 ASSERT((alignment & (alignment - 1)) == 0); in AlignedAlloc() 27 ASSERT((alignment % sizeof(void *)) == 0); in AlignedAlloc() 30 ptr = _aligned_malloc(size, alignment); in AlignedAlloc() 37 ptr = memalign(alignment, size); in AlignedAlloc() 39 if (posix_memalign(&ptr, alignment, size)) in AlignedAlloc() 47 << "size=" << size << ", alignment=" << alignment; in AlignedAlloc() 51 ASSERT((reinterpret_cast<uintptr_t>(ptr) & (alignment - 1)) == 0); in AlignedAlloc()
|
/third_party/mesa3d/src/util/ |
D | os_memory_aligned.h | 54 os_malloc_aligned(size_t size, size_t alignment) in os_malloc_aligned() argument 57 alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1); in os_malloc_aligned() 58 if(posix_memalign(&ptr, alignment, size) != 0) in os_malloc_aligned() 71 os_malloc_aligned(size_t size, size_t alignment) in os_malloc_aligned() argument 83 if (add_overflow_size_t(size, alignment, &alloc_size) || in os_malloc_aligned() 92 … buf = (char *)(((uintptr_t)ptr + sizeof(void *) + alignment - 1) & ~((uintptr_t)(alignment - 1))); in os_malloc_aligned() 118 os_realloc_aligned(void *ptr, size_t oldsize, size_t newsize, size_t alignment) in os_realloc_aligned() argument 121 void *newBuf = os_malloc_aligned(newsize, alignment); in os_realloc_aligned()
|
/third_party/skia/third_party/externals/swiftshader/src/System/ |
D | Memory.cpp | 76 static void *allocate(size_t bytes, size_t alignment, bool clearToZero) in allocate() argument 78 ASSERT((alignment & (alignment - 1)) == 0); // Power of 2 alignment. in allocate() 80 size_t size = bytes + sizeof(Allocation) + alignment; in allocate() 91 … (unsigned char *)((uintptr_t)(block + sizeof(Allocation) + alignment - 1) & -(intptr_t)alignment); in allocate() 102 void *allocateUninitialized(size_t bytes, size_t alignment) in allocateUninitialized() argument 104 return allocate(bytes, alignment, false); in allocateUninitialized() 107 void *allocateZero(size_t bytes, size_t alignment) in allocateZero() argument 109 return allocate(bytes, alignment, true); in allocateZero() 114 void *allocateZeroOrPoison(size_t bytes, size_t alignment) in allocateZeroOrPoison() argument 116 return allocate(bytes, alignment, !__has_feature(memory_sanitizer)); in allocateZeroOrPoison()
|
/third_party/skia/third_party/externals/swiftshader/third_party/marl/src/ |
D | memory.cpp | 139 void* pagedMalloc(size_t alignment, in pagedMalloc() argument 143 (void)alignment; in pagedMalloc() 144 MARL_ASSERT(alignment < pageSize(), in pagedMalloc() 146 int(alignment), int(pageSize())); in pagedMalloc() 163 size_t alignment, in pagedFree() argument 167 (void)alignment; in pagedFree() 168 MARL_ASSERT(alignment < pageSize(), in pagedFree() 170 int(alignment), int(pageSize())); in pagedFree() 183 inline void* alignedMalloc(size_t alignment, size_t size) { in alignedMalloc() argument 184 size_t allocSize = size + alignment + sizeof(void*); in alignedMalloc() [all …]
|
/third_party/boost/boost/align/detail/ |
D | aligned_alloc_new.hpp | 18 namespace alignment { namespace 21 aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT in aligned_alloc() argument 23 BOOST_ASSERT(detail::is_alignment(alignment)); in aligned_alloc() 27 if (alignment < N) { in aligned_alloc() 28 alignment = N; in aligned_alloc() 30 std::size_t n = size + alignment - N; in aligned_alloc() 34 (void)boost::alignment::align(alignment, size, r, n); in aligned_alloc()
|
D | aligned_alloc.hpp | 18 namespace alignment { namespace 21 aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT in aligned_alloc() argument 23 BOOST_ASSERT(detail::is_alignment(alignment)); in aligned_alloc() 27 if (alignment < N) { in aligned_alloc() 28 alignment = N; in aligned_alloc() 30 std::size_t n = size + alignment - N; in aligned_alloc() 34 (void)boost::alignment::align(alignment, size, r, n); in aligned_alloc()
|
D | is_aligned.hpp | 15 namespace alignment { namespace 18 is_aligned(const volatile void* ptr, std::size_t alignment) BOOST_NOEXCEPT in is_aligned() argument 20 BOOST_ASSERT(detail::is_alignment(alignment)); in is_aligned() 21 return (reinterpret_cast<std::size_t>(ptr) & (alignment - 1)) == 0; in is_aligned() 25 is_aligned(std::size_t alignment, const volatile void* ptr) BOOST_NOEXCEPT in is_aligned() argument 27 BOOST_ASSERT(detail::is_alignment(alignment)); in is_aligned() 28 return (reinterpret_cast<std::size_t>(ptr) & (alignment - 1)) == 0; in is_aligned()
|
/third_party/boost/boost/gil/ |
D | image.hpp | 61 explicit image(std::size_t alignment=0, in image() argument 63 _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {} in image() 67 std::size_t alignment=0, in image() argument 68 … const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in) in image() 75 std::size_t alignment=0, in image() argument 76 … const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in) in image() 84 std::size_t alignment = 0, in image() argument 85 … const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in) in image() 93 std::size_t alignment = 0, in image() argument 94 … const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in) in image() [all …]
|
/third_party/flatbuffers/swift/Sources/FlatBuffers/ |
D | ByteBuffer.swift | 34 init(count: Int, alignment: Int) { 35 memory = UnsafeMutableRawPointer.allocate(byteCount: count, alignment: alignment) 72 internal func reallocate(_ size: Int, writerSize: Int, alignment: Int) { in reallocate() 81 let newData = UnsafeMutableRawPointer.allocate(byteCount: capacity, alignment: alignment) in reallocate() 97 internal var alignment = 1 variable 114 _storage = Storage(count: bytes.count, alignment: alignment) 125 _storage = Storage(count: data.count, alignment: alignment) 136 _storage = Storage(count: size, alignment: alignment) 149 _storage = Storage(count: count, alignment: alignment) 170 _storage = Storage(count: count, alignment: alignment) [all …]
|
/third_party/flutter/skia/include/gpu/ |
D | GrTypes.h | 151 static inline constexpr uint32_t GrUIAlignUp(uint32_t x, uint32_t alignment) { in GrUIAlignUp() argument 152 return GrUIDivRoundUp(x, alignment) * alignment; in GrUIAlignUp() 154 static inline constexpr size_t GrSizeAlignUp(size_t x, size_t alignment) { in GrSizeAlignUp() argument 155 return GrSizeDivRoundUp(x, alignment) * alignment; in GrSizeAlignUp() 161 static inline constexpr uint32_t GrUIAlignUpPad(uint32_t x, uint32_t alignment) { in GrUIAlignUpPad() argument 162 return (alignment - x % alignment) % alignment; in GrUIAlignUpPad() 164 static inline constexpr size_t GrSizeAlignUpPad(size_t x, size_t alignment) { in GrSizeAlignUpPad() argument 165 return (alignment - x % alignment) % alignment; in GrSizeAlignUpPad() 171 static inline constexpr uint32_t GrUIAlignDown(uint32_t x, uint32_t alignment) { in GrUIAlignDown() argument 172 return (x / alignment) * alignment; in GrUIAlignDown() [all …]
|