/bionic/benchmarks/tests/ |
D | benchmark_test.cpp | 22 for (size_t alignment = 1; alignment <= 32; alignment *= 2) { in TEST() local 23 for (size_t or_mask = 0; or_mask < alignment; ++or_mask) { in TEST() 24 uintptr_t aligned_ptr = reinterpret_cast<uintptr_t>(GetAlignedMemory(buf.data(), alignment, in TEST() 26 ASSERT_EQ(aligned_ptr % alignment, or_mask); in TEST() 27 ASSERT_EQ(aligned_ptr & alignment, alignment); in TEST() 34 for (size_t alignment = 1; alignment <= 2048; alignment *= 2) { in TEST() local 35 uintptr_t aligned_ptr = reinterpret_cast<uintptr_t>(GetAlignedPtr(&buf, alignment, 100)); in TEST() 36 ASSERT_EQ(aligned_ptr & alignment, alignment); in TEST() 37 ASSERT_EQ(aligned_ptr & (alignment - 1), 0u); in TEST()
|
/bionic/benchmarks/ |
D | util.cpp | 26 char *GetAlignedMemory(char *orig_ptr, size_t alignment, size_t or_mask) { in GetAlignedMemory() argument 27 if ((alignment & (alignment - 1)) != 0) { in GetAlignedMemory() 31 if (or_mask > alignment) { in GetAlignedMemory() 36 if (alignment > 0) { in GetAlignedMemory() 40 ptr += alignment - (ptr & (alignment - 1)); in GetAlignedMemory() 41 ptr |= alignment | or_mask; in GetAlignedMemory() 47 char *GetAlignedPtr(std::vector<char>* buf, size_t alignment, size_t nbytes) { in GetAlignedPtr() argument 48 buf->resize(nbytes + 3 * alignment); in GetAlignedPtr() 49 return GetAlignedMemory(buf->data(), alignment, 0); in GetAlignedPtr() 52 char *GetAlignedPtrFilled(std::vector<char>* buf, size_t alignment, size_t nbytes, char fill_byte) { in GetAlignedPtrFilled() argument [all …]
|
D | util.h | 23 char *GetAlignedMemory(char *orig_ptr, size_t alignment, size_t or_mask); 25 char *GetAlignedPtr(std::vector<char>* buf, size_t alignment, size_t nbytes); 27 char *GetAlignedPtrFilled(std::vector<char>* buf, size_t alignment, size_t nbytes, char fill_byte);
|
D | string_benchmark.cpp | 100 const size_t alignment = state.range(1); in BM_string_memmove_overlap_dst_before_src() local 102 std::vector<char> buf(3 * alignment + nbytes + 1, 'x'); in BM_string_memmove_overlap_dst_before_src() 103 char* buf_aligned = GetAlignedPtrFilled(&buf, alignment, nbytes + 1, 'x'); in BM_string_memmove_overlap_dst_before_src() 115 const size_t alignment = state.range(1); in BM_string_memmove_overlap_src_before_dst() local 118 char* buf_aligned = GetAlignedPtrFilled(&buf, alignment, nbytes + 1, 'x'); in BM_string_memmove_overlap_src_before_dst() 130 const size_t alignment = state.range(1); in BM_string_memset() local 133 char* buf_aligned = GetAlignedPtr(&buf, alignment, nbytes + 1); in BM_string_memset() 145 const size_t alignment = state.range(1); in BM_string_strlen() local 148 char* buf_aligned = GetAlignedPtrFilled(&buf, alignment, nbytes + 1, 'x'); in BM_string_strlen()
|
/bionic/tests/libs/ |
D | bionic_tests_zipalign.cpp | 68 static bool CreateAlignedZip(ZipArchiveHandle& handle, FILE* zip_dst, uint32_t alignment) { in CreateAlignedZip() argument 88 error = writer.StartAlignedEntry(zip_name.c_str(), flags, alignment); in CreateAlignedZip() 128 unsigned long int alignment = strtoul(argv[1], &end, 10); in main() local 129 if ((alignment == ULONG_MAX && errno == ERANGE) || *end != '\0') { in main() 134 if (((alignment - 1) & alignment) != 0) { in main() 154 bool success = CreateAlignedZip(handle, zip_dst, static_cast<uint32_t>(alignment)); in main()
|
/bionic/libc/private/ |
D | bionic_macros.h | 43 #define BIONIC_ALIGN(value, alignment) \ argument 44 (((value) + (alignment) - 1) & ~((alignment) - 1))
|
/bionic/libc/malloc_debug/ |
D | malloc_debug.cpp | 76 void* debug_memalign(size_t alignment, size_t bytes); 81 int debug_posix_memalign(void** memptr, size_t alignment, size_t size); 412 void* debug_memalign(size_t alignment, size_t bytes) { in debug_memalign() argument 414 return g_dispatch->memalign(alignment, bytes); in debug_memalign() 430 if (!powerof2(alignment)) { in debug_memalign() 431 alignment = BIONIC_ROUND_UP_POWER_OF_2(alignment); in debug_memalign() 435 if (alignment < MINIMUM_ALIGNMENT_BYTES) { in debug_memalign() 436 alignment = MINIMUM_ALIGNMENT_BYTES; in debug_memalign() 442 size_t real_size = alignment + bytes + g_debug->extra_bytes(); in debug_memalign() 456 value += (-value % alignment); in debug_memalign() [all …]
|
D | RecordData.cpp | 90 MemalignEntry::MemalignEntry(void* pointer, size_t size, size_t alignment) in MemalignEntry() argument 91 : MallocEntry(pointer, size), alignment_(alignment) { in MemalignEntry()
|
D | RecordData.h | 135 MemalignEntry(void* pointer, size_t size, size_t alignment);
|
D | README.md | 292 pointer = memalign(alignment, size) 294 **THREAD\_ID**: memalign pointer alignment size 296 posix\_memalign(&pointer, alignment, size) 298 **THREAD\_ID**: memalign pointer alignment size
|
/bionic/tests/ |
D | malloc_test.cpp | 79 for (size_t alignment = 1 << i; alignment < (1U << (i+1)); alignment++) { in TEST() local 80 char *ptr = reinterpret_cast<char*>(memalign(alignment, 100)); in TEST() 81 ASSERT_TRUE(ptr != NULL) << "Failed at alignment " << alignment; in TEST() 82 ASSERT_LE(100U, malloc_usable_size(ptr)) << "Failed at alignment " << alignment; in TEST() 84 << "Failed at alignment " << alignment; in TEST() 105 for (size_t alignment = 1; alignment <= 4096; alignment <<= 1) { in TEST() local 106 char *ptr = (char*)memalign(alignment, 100); in TEST() 109 ASSERT_EQ(0U, (intptr_t)ptr % alignment); in TEST()
|
D | buffer_tests.cpp | 195 static void *GetAlignedPtr(void *orig_ptr, int alignment, int or_mask) { in GetAlignedPtr() argument 197 if (alignment > 0) { in GetAlignedPtr() 201 ptr += alignment - (ptr & (alignment - 1)); in GetAlignedPtr() 202 ptr |= alignment | or_mask; in GetAlignedPtr()
|
D | pthread_test.cpp | 1783 void* allocate(size_t size, size_t alignment) { in allocate() argument 1784 char* p = new char[size + alignment * 2]; in allocate() 1786 while (!is_strict_aligned(p, alignment)) { in allocate() 1799 bool is_strict_aligned(char* p, size_t alignment) { in is_strict_aligned() argument 1800 return (reinterpret_cast<uintptr_t>(p) % (alignment * 2)) == alignment; in is_strict_aligned()
|
/bionic/libc/bionic/ |
D | malloc_common.cpp | 129 extern "C" void* memalign(size_t alignment, size_t bytes) { in memalign() argument 132 return _memalign(alignment, bytes); in memalign() 134 return Malloc(memalign)(alignment, bytes); in memalign() 137 extern "C" int posix_memalign(void** memptr, size_t alignment, size_t size) { in posix_memalign() argument 140 return _posix_memalign(memptr, alignment, size); in posix_memalign() 142 return Malloc(posix_memalign)(memptr, alignment, size); in posix_memalign()
|
/bionic/libc/include/ |
D | malloc.h | 38 void* memalign(size_t alignment, size_t byte_count) __mallocfunc __BIONIC_ALLOC_SIZE(2) __wur;
|
D | stdlib.h | 75 int posix_memalign(void** memptr, size_t alignment, size_t size) __INTRODUCED_IN(16);
|
/bionic/libc/kernel/uapi/mtd/ |
D | ubi-user.h | 61 __s32 alignment; member
|
/bionic/libc/malloc_debug/tests/ |
D | malloc_debug_unit_tests.cpp | 324 for (size_t alignment = 1; alignment <= 256; alignment++) { in TEST_F() local 325 pointer = reinterpret_cast<uint8_t*>(debug_memalign(alignment, 100)); in TEST_F() 328 size_t alignment_mask = alignment - 1; in TEST_F() 329 if (!powerof2(alignment)) { in TEST_F() 330 alignment_mask = BIONIC_ROUND_UP_POWER_OF_2(alignment) - 1; in TEST_F() 416 for (size_t alignment = 1; alignment <= 256; alignment++) { in TEST_F() local 417 pointer = reinterpret_cast<uint8_t*>(debug_memalign(alignment, 100)); in TEST_F() 421 size_t alignment_mask = alignment - 1; in TEST_F() 422 if (!powerof2(alignment)) { in TEST_F() 423 alignment_mask = BIONIC_ROUND_UP_POWER_OF_2(alignment) - 1; in TEST_F() [all …]
|
/bionic/libc/kernel/uapi/drm/ |
D | i915_drm.h | 303 int alignment; member 396 __u64 alignment; member 413 __u64 alignment; member 470 __u64 alignment; member
|
D | radeon_drm.h | 560 int alignment; member 614 __u64 alignment; member
|
D | amdgpu_drm.h | 64 __u64 alignment; member
|
/bionic/linker/ |
D | linker_phdr.h | 68 bool CheckFileRange(ElfW(Addr) offset, size_t size, size_t alignment);
|
D | linker_phdr.cpp | 290 bool ElfReader::CheckFileRange(ElfW(Addr) offset, size_t size, size_t alignment) { in CheckFileRange() argument 303 ((offset % alignment) == 0); in CheckFileRange()
|
/bionic/ |
D | android-changes-for-ndk-developers.md | 112 Current versions of the zipalign tool take care of alignment.
|