Home
last modified time | relevance | path

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

12345678910>>...97

/external/jemalloc/test/integration/
Dposix_memalign.c21 size_t alignment; in TEST_BEGIN() local
24 for (alignment = 0; alignment < sizeof(void *); alignment++) { in TEST_BEGIN()
25 assert_d_eq(posix_memalign(&p, alignment, 1), EINVAL, in TEST_BEGIN()
27 alignment); in TEST_BEGIN()
30 for (alignment = sizeof(size_t); alignment < MAXALIGN; in TEST_BEGIN()
31 alignment <<= 1) { in TEST_BEGIN()
32 assert_d_ne(posix_memalign(&p, alignment + 1, 1), 0, in TEST_BEGIN()
34 alignment + 1); in TEST_BEGIN()
41 size_t alignment, size; in TEST_BEGIN() local
45 alignment = UINT64_C(0x8000000000000000); in TEST_BEGIN()
[all …]
Daligned_alloc.c21 size_t alignment; in TEST_BEGIN() local
24 alignment = 0; in TEST_BEGIN()
26 p = aligned_alloc(alignment, 1); in TEST_BEGIN()
28 "Expected error for invalid alignment %zu", alignment); in TEST_BEGIN()
30 for (alignment = sizeof(size_t); alignment < MAXALIGN; in TEST_BEGIN()
31 alignment <<= 1) { in TEST_BEGIN()
33 p = aligned_alloc(alignment + 1, 1); in TEST_BEGIN()
36 alignment + 1); in TEST_BEGIN()
43 size_t alignment, size; in TEST_BEGIN() local
47 alignment = UINT64_C(0x8000000000000000); in TEST_BEGIN()
[all …]
/external/jemalloc_new/test/integration/
Dposix_memalign.c17 size_t alignment; in TEST_BEGIN() local
20 for (alignment = 0; alignment < sizeof(void *); alignment++) { in TEST_BEGIN()
21 assert_d_eq(posix_memalign(&p, alignment, 1), EINVAL, in TEST_BEGIN()
23 alignment); in TEST_BEGIN()
26 for (alignment = sizeof(size_t); alignment < MAXALIGN; in TEST_BEGIN()
27 alignment <<= 1) { in TEST_BEGIN()
28 assert_d_ne(posix_memalign(&p, alignment + 1, 1), 0, in TEST_BEGIN()
30 alignment + 1); in TEST_BEGIN()
36 size_t alignment, size; in TEST_BEGIN() local
40 alignment = UINT64_C(0x8000000000000000); in TEST_BEGIN()
[all …]
Daligned_alloc.c17 size_t alignment; in TEST_BEGIN() local
20 alignment = 0; in TEST_BEGIN()
22 p = aligned_alloc(alignment, 1); in TEST_BEGIN()
24 "Expected error for invalid alignment %zu", alignment); in TEST_BEGIN()
26 for (alignment = sizeof(size_t); alignment < MAXALIGN; in TEST_BEGIN()
27 alignment <<= 1) { in TEST_BEGIN()
29 p = aligned_alloc(alignment + 1, 1); in TEST_BEGIN()
32 alignment + 1); in TEST_BEGIN()
38 size_t alignment, size; in TEST_BEGIN() local
42 alignment = UINT64_C(0x8000000000000000); in TEST_BEGIN()
[all …]
/external/python/cpython2/Lib/lib2to3/tests/data/
Dinfinite_recursion.py41 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 …]
/external/python/cpython3/Lib/lib2to3/tests/data/
Dinfinite_recursion.py41 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 …]
/external/tensorflow/tensorflow/compiler/tf2tensorrt/utils/
Dtrt_allocator_test.cc23 bool RunTest(const uint64_t alignment, const uint64_t size, in RunTest() argument
28 void* result = Align(alignment, size, ptr, space); in RunTest()
36 EXPECT_EQ(0, ptr_val % alignment); in RunTest()
49 for (uint64_t alignment = 1; alignment <= space * 4; alignment *= 2) { in TEST() local
52 alignment == 1 ? static_cast<uint64_t>(1) : alignment - 1, in TEST()
53 alignment, alignment + 1, alignment + (alignment / 2)}) { in TEST()
54 if (ptr_val % alignment == 0) { in TEST()
59 EXPECT_EQ(space >= size, RunTest(alignment, size, ptr_val, space)); in TEST()
62 EXPECT_FALSE(RunTest(alignment, space, ptr_val, space)); in TEST()
63 const uint64_t diff = alignment - ptr_val % alignment; in TEST()
[all …]
Dtrt_allocator.cc34 void* Align(uint64_t alignment, uint64_t size, void*& ptr, uint64_t& space) { in Align() argument
35 QCHECK_GT(alignment, 0ul) << "alignment must be greater than 0."; in Align()
36 QCHECK_EQ(0, alignment & (alignment - 1)) << "Alignment must be power of 2."; in Align()
44 const uintptr_t aligned_ptr_val = ((ptr_val + alignment - 1) & -alignment); in Align()
61 void* TRTCudaAllocator::allocate(uint64_t size, uint64_t alignment, in allocate() argument
63 assert((alignment & (alignment - 1)) == 0); // zero or a power of 2. in allocate()
71 void* TRTDeviceAllocator::allocate(uint64_t size, uint64_t alignment, in allocate() argument
77 alignment = 512; in allocate()
78 assert((alignment & (alignment - 1)) == 0); // zero or a power of 2. in allocate()
79 uint64_t total_size = size + alignment; in allocate()
[all …]
/external/skqp/tests/
DSkSLMemoryLayoutTest.cpp35 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 …]
/external/skia/tests/
DSkSLMemoryLayoutTest.cpp35 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 …]
DMemsetTest.cpp51 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()
/external/libcxxabi/src/
Dstdlib_new_delete.cpp141 operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC in operator new() argument
145 if (static_cast<size_t>(alignment) < sizeof(void*)) in operator new()
146 alignment = std::align_val_t(sizeof(void*)); in operator new()
149 while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr) in operator new()
151 while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0) in operator new()
173 operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT in operator new() argument
180 p = ::operator new(size, alignment); in operator new()
192 operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC in operator new[]() argument
194 return ::operator new(size, alignment); in operator new[]()
199 operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT in operator new[]() argument
[all …]
/external/libcxx/src/
Dnew.cpp180 operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC in operator new() argument
184 if (static_cast<size_t>(alignment) < sizeof(void*)) in operator new()
185 alignment = std::align_val_t(sizeof(void*)); in operator new()
188 while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr) in operator new()
190 while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0) in operator new()
212 operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT in operator new() argument
219 p = ::operator new(size, alignment); in operator new()
231 operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC in operator new[]() argument
233 return ::operator new(size, alignment); in operator new[]()
238 operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT in operator new[]() argument
[all …]
/external/skia/src/sksl/
DSkSLMemoryLayout.h47 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 …]
/external/skqp/src/sksl/
DSkSLMemoryLayout.h47 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 …]
/external/apache-commons-compress/src/main/java/org/apache/commons/compress/archivers/zip/
DResourceAlignmentExtraField.java49 private short alignment; field in ResourceAlignmentExtraField
58 public ResourceAlignmentExtraField(int alignment) { in ResourceAlignmentExtraField() argument
59 this(alignment, false); in ResourceAlignmentExtraField()
62 public ResourceAlignmentExtraField(int alignment, boolean allowMethodChange) { in ResourceAlignmentExtraField() argument
63 this(alignment, allowMethodChange, 0); in ResourceAlignmentExtraField()
66 public ResourceAlignmentExtraField(int alignment, boolean allowMethodChange, int padding) { in ResourceAlignmentExtraField() argument
67 if (alignment < 0 || alignment > 0x7fff) { in ResourceAlignmentExtraField()
68 … throw new IllegalArgumentException("Alignment must be between 0 and 0x7fff, was: " + alignment); in ResourceAlignmentExtraField()
70 this.alignment = (short) alignment; in ResourceAlignmentExtraField()
82 return alignment; in getAlignment()
[all …]
/external/webrtc/webrtc/system_wrappers/source/
Daligned_malloc.cc28 uintptr_t GetRightAlign(uintptr_t start_pos, size_t alignment) { in GetRightAlign() argument
31 return (start_pos + alignment - 1) & ~(alignment - 1); in GetRightAlign()
35 bool ValidAlignment(size_t alignment) { in ValidAlignment() argument
36 if (!alignment) { in ValidAlignment()
39 return (alignment & (alignment - 1)) == 0; in ValidAlignment()
42 void* GetRightAlign(const void* pointer, size_t alignment) { in GetRightAlign() argument
46 if (!ValidAlignment(alignment)) { in GetRightAlign()
50 return reinterpret_cast<void*>(GetRightAlign(start_pos, alignment)); in GetRightAlign()
53 void* AlignedMalloc(size_t size, size_t alignment) { in AlignedMalloc() argument
57 if (!ValidAlignment(alignment)) { in AlignedMalloc()
[all …]
Daligned_malloc_unittest.cc26 bool CorrectUsage(size_t size, size_t alignment) { in CorrectUsage() argument
28 static_cast<char*>(AlignedMalloc(size, alignment))); in CorrectUsage()
33 return 0u == scoped_address % alignment; in CorrectUsage()
38 const size_t alignment = 32; in TEST() local
41 static_cast<char*>(AlignedMalloc(size, alignment))); in TEST()
47 const char* realigned_ptr = GetRightAlign(misaligned_ptr, alignment); in TEST()
53 const size_t alignment = 64; in TEST() local
54 EXPECT_FALSE(CorrectUsage(incorrect_size, alignment)); in TEST()
65 size_t alignment = 2; in TEST() local
66 EXPECT_TRUE(CorrectUsage(size, alignment)); in TEST()
[all …]
/external/llvm/test/MC/ARM/
Dneon-vld-vst-align.s13 @ CHECK-ERRORS: error: alignment must be 64 or omitted
16 @ CHECK-ERRORS: error: alignment must be 64 or omitted
20 @ CHECK-ERRORS: error: alignment must be 64 or omitted
23 @ CHECK-ERRORS: error: alignment must be 64 or omitted
35 @ CHECK-ERRORS: error: alignment must be 64 or omitted
38 @ CHECK-ERRORS: error: alignment must be 64 or omitted
42 @ CHECK-ERRORS: error: alignment must be 64 or omitted
45 @ CHECK-ERRORS: error: alignment must be 64 or omitted
57 @ CHECK-ERRORS: error: alignment must be 64 or omitted
60 @ CHECK-ERRORS: error: alignment must be 64 or omitted
[all …]
/external/swiftshader/third_party/llvm-7.0/llvm/test/MC/ARM/
Dneon-vld-vst-align.s13 @ CHECK-ERRORS: alignment must be 64 or omitted
16 @ CHECK-ERRORS: alignment must be 64 or omitted
20 @ CHECK-ERRORS: alignment must be 64 or omitted
23 @ CHECK-ERRORS: alignment must be 64 or omitted
35 @ CHECK-ERRORS: alignment must be 64 or omitted
38 @ CHECK-ERRORS: alignment must be 64 or omitted
42 @ CHECK-ERRORS: alignment must be 64 or omitted
45 @ CHECK-ERRORS: alignment must be 64 or omitted
57 @ CHECK-ERRORS: alignment must be 64 or omitted
60 @ CHECK-ERRORS: alignment must be 64 or omitted
[all …]
/external/mesa3d/src/mesa/main/
Dimports.c84 _mesa_align_malloc(size_t bytes, unsigned long alignment) in _mesa_align_malloc() argument
88 int err = posix_memalign(& mem, alignment, bytes); in _mesa_align_malloc()
93 return _aligned_malloc(bytes, alignment); in _mesa_align_malloc()
97 assert( alignment > 0 ); in _mesa_align_malloc()
99 ptr = (uintptr_t)malloc(bytes + alignment + sizeof(void *)); in _mesa_align_malloc()
103 buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1); in _mesa_align_malloc()
123 _mesa_align_calloc(size_t bytes, unsigned long alignment) in _mesa_align_calloc() argument
128 mem = _mesa_align_malloc(bytes, alignment); in _mesa_align_calloc()
137 mem = _aligned_malloc(bytes, alignment); in _mesa_align_calloc()
146 assert( alignment > 0 ); in _mesa_align_calloc()
[all …]
/external/tensorflow/tensorflow/core/lib/core/
Darena.cc72 bool Arena::SatisfyAlignment(size_t alignment) { in SatisfyAlignment() argument
73 const size_t overage = reinterpret_cast<size_t>(freestart_) & (alignment - 1); in SatisfyAlignment()
75 const size_t waste = alignment - overage; in SatisfyAlignment()
82 DCHECK_EQ(size_t{0}, reinterpret_cast<size_t>(freestart_) & (alignment - 1)); in SatisfyAlignment()
110 void Arena::MakeNewBlock(const uint32 alignment) { in MakeNewBlock() argument
111 AllocatedBlock* block = AllocNewBlock(block_size_, alignment); in MakeNewBlock()
114 CHECK(SatisfyAlignment(alignment)); in MakeNewBlock()
136 const uint32 alignment) { in AllocNewBlock() argument
158 (alignment > 1 ? LeastCommonMultiple(alignment, kDefaultAlignment) : 1); in AllocNewBlock()
178 << " alignment=" << alignment in AllocNewBlock()
[all …]
/external/python/cpython3/Modules/_ctypes/libffi_osx/
Dffi.c44 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 …]
/external/python/cpython2/Modules/_ctypes/libffi_osx/
Dffi.c43 arg->size != 0 || arg->alignment != 0) in initialize_aggregate()
57 int curalign = (*ptr)->alignment; in initialize_aggregate()
67 arg->alignment = (arg->alignment > curalign) ? in initialize_aggregate()
68 arg->alignment : curalign; in initialize_aggregate()
70 arg->size = ALIGN(arg->size, (*ptr)->alignment); in initialize_aggregate()
72 arg->alignment = (arg->alignment > (*ptr)->alignment) ? in initialize_aggregate()
73 arg->alignment : (*ptr)->alignment; in initialize_aggregate()
86 arg->size = ALIGN(arg->size, arg->alignment); in initialize_aggregate()
183 if ((*ptr)->alignment == 0) in ffi_prep_cif()
192 int align = (*ptr)->alignment; in ffi_prep_cif()
[all …]
/external/jemalloc_new/include/jemalloc/internal/
Djemalloc_internal_inlines_c.h67 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 extra, size_t alignment, bool zero, tcache_t *tcache, in iralloct_realign() argument
143 usize = sz_sa2u(size + extra, alignment); in iralloct_realign()
[all …]

12345678910>>...97