/system/memory/libion/tests/ |
D | map_test.cpp | 39 void* ptr; in TEST_F() local 40 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F() 41 ASSERT_TRUE(ptr != NULL); in TEST_F() 44 memset(ptr, 0xaa, size); in TEST_F() 46 ASSERT_EQ(0, munmap(ptr, size)); in TEST_F() 60 unsigned char* ptr; in TEST_F() local 61 ptr = (unsigned char*)mmap(NULL, getpagesize() * 2, PROT_READ | PROT_WRITE, MAP_SHARED, in TEST_F() 63 ASSERT_TRUE(ptr != NULL); in TEST_F() 65 memset(ptr, 0, getpagesize()); in TEST_F() 66 memset(ptr + getpagesize(), 0xaa, getpagesize()); in TEST_F() [all …]
|
D | exit_test.cpp | 87 void* ptr; in TEST_F() 88 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F() 89 ASSERT_TRUE(ptr != NULL); in TEST_F() 111 void* ptr; in TEST_F() 112 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F() 113 ASSERT_TRUE(ptr != NULL); in TEST_F() 115 ASSERT_EQ(0, munmap(ptr, size / 2)); in TEST_F() 138 void* ptr; in TEST_F() 139 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F() 140 ASSERT_TRUE(ptr != NULL); in TEST_F() [all …]
|
/system/memory/libmemunreachable/tests/ |
D | DisableMalloc_test.cpp | 59 void* ptr = malloc(128); in TEST_F() 60 ASSERT_NE(ptr, nullptr); in TEST_F() 61 free(ptr); in TEST_F() 65 void* ptr = malloc(128); in TEST_F() 66 ASSERT_NE(ptr, nullptr); in TEST_F() 67 free(ptr); in TEST_F() 79 void* ptr = ::operator new(1); in TEST_F() 80 ASSERT_NE(ptr, nullptr); in TEST_F() 81 ::operator delete(ptr); in TEST_F() 85 void* ptr = ::operator new(1); in TEST_F() [all …]
|
D | Allocator_test.cpp | 43 void* ptr = allocator.allocate(); in TEST_F() local 44 ASSERT_TRUE(ptr != NULL); in TEST_F() 45 allocator.deallocate(ptr); in TEST_F() 66 void* ptr[num]; in TEST_F() local 68 ptr[i] = allocator.allocate(); in TEST_F() 69 memset(ptr[i], 0xaa, size); in TEST_F() 70 *(reinterpret_cast<unsigned char*>(ptr[i])) = i; in TEST_F() 76 ASSERT_NE(ptr[i], ptr[j]); in TEST_F() 82 ASSERT_EQ(*(reinterpret_cast<unsigned char*>(ptr[i])), i & 0xFF); in TEST_F() 83 allocator.deallocate(ptr[i]); in TEST_F() [all …]
|
/system/memory/libmemunreachable/ |
D | Allocator.cpp | 75 void operator delete(void* ptr); 78 void Free(void* ptr); 92 void MapFree(void* ptr); 94 void FreeLocked(void* ptr); 97 void* ptr; member 131 void* ptr = mmap(NULL, map_size, prot, flags, -1, 0); in MapAligned() local 132 if (ptr == MAP_FAILED) { in MapAligned() 137 void* aligned_ptr = ptr; in MapAligned() 142 if (aligned_ptr != ptr) { in MapAligned() 143 ptrdiff_t extra = reinterpret_cast<uintptr_t>(aligned_ptr) - reinterpret_cast<uintptr_t>(ptr); in MapAligned() [all …]
|
/system/bt/osi/src/ |
D | allocator.cc | 30 void* ptr = malloc(real_size); in osi_strdup() local 31 CHECK(ptr); in osi_strdup() 34 allocation_tracker_notify_alloc(alloc_allocator_id, ptr, size)); in osi_strdup() 46 void* ptr = malloc(real_size); in osi_strndup() local 47 CHECK(ptr); in osi_strndup() 50 allocation_tracker_notify_alloc(alloc_allocator_id, ptr, size + 1)); in osi_strndup() 60 void* ptr = malloc(real_size); in osi_malloc() local 61 CHECK(ptr); in osi_malloc() 62 return allocation_tracker_notify_alloc(alloc_allocator_id, ptr, size); in osi_malloc() 67 void* ptr = calloc(1, real_size); in osi_calloc() local [all …]
|
D | allocation_tracker.cc | 35 void* ptr; member 92 __func__, (uintptr_t)allocation->ptr, allocation->size); in allocation_tracker_expect_no_allocations() 99 void* allocation_tracker_notify_alloc(uint8_t allocator_id, void* ptr, in allocation_tracker_notify_alloc() argument 104 if (!enabled || !ptr) return ptr; in allocation_tracker_notify_alloc() 110 return_ptr = ((char*)ptr) + canary_size; in allocation_tracker_notify_alloc() 125 allocation->ptr = return_ptr; in allocation_tracker_notify_alloc() 136 void* ptr) { in allocation_tracker_notify_free() argument 139 if (!enabled || !ptr) return ptr; in allocation_tracker_notify_free() 141 auto map_entry = allocations.find(ptr); in allocation_tracker_notify_free() 155 UNUSED_ATTR const char* beginning_canary = ((char*)ptr) - canary_size; in allocation_tracker_notify_free() [all …]
|
/system/extras/memory_replay/ |
D | TraceBenchmark.cpp | 60 void* ptr = trace_data->ptrs[i]; in FreePtrs() local 61 if (ptr != nullptr) { in FreePtrs() 62 free(ptr); in FreePtrs() 108 ptr_to_index[entry->ptr] = idx; in GetTraceData() 109 entry->ptr = idx; in GetTraceData() 124 ptr_to_index[entry->ptr] = idx; in GetTraceData() 125 entry->ptr = idx; in GetTraceData() 129 if (entry->ptr != 0) { in GetTraceData() 130 auto idx_entry = ptr_to_index.find(entry->ptr); in GetTraceData() 132 errx(1, "File Error: Unable to find free pointer %" PRIx64, entry->ptr); in GetTraceData() [all …]
|
/system/media/audio_utils/ |
D | tinysndfile.c | 39 static unsigned little2u(unsigned char *ptr) in little2u() argument 41 return (ptr[1] << 8) + ptr[0]; in little2u() 44 static unsigned little4u(unsigned char *ptr) in little4u() argument 46 return (ptr[3] << 24) + (ptr[2] << 16) + (ptr[1] << 8) + ptr[0]; in little4u() 56 static void my_swab(short *ptr, size_t numToSwap) in my_swab() argument 59 *ptr = little2u((unsigned char *) ptr); in my_swab() 61 ++ptr; in my_swab() 289 static void write4u(unsigned char *ptr, unsigned u) in write4u() argument 291 ptr[0] = u; in write4u() 292 ptr[1] = u >> 8; in write4u() [all …]
|
/system/memory/libion/ |
D | ion_test.c | 78 unsigned char *ptr; in ion_map_test() local 83 ret = ion_map(fd, handle, len, prot, map_flags, 0, &ptr, &map_fd); in ion_map_test() 88 ptr[i] = (unsigned char)i; in ion_map_test() 91 if (ptr[i] != (unsigned char)i) in ion_map_test() 93 "memory\n", __func__, i, ptr[i]); in ion_map_test() 97 munmap(ptr, len); in ion_map_test() 104 munmap(ptr, len); in ion_map_test() 110 ret = ion_map(fd, handle, len, prot, flags, 0, &ptr, &map_fd); in ion_map_test() 137 char *ptr; in ion_share_test() local 144 ptr = mmap(NULL, len, prot, map_flags, share_fd, 0); in ion_share_test() [all …]
|
/system/bt/osi/test/fuzzers/allocator/ |
D | fuzz_allocator.cc | 39 void* ptr = nullptr; in callArbitraryFunction() local 44 ptr = osi_malloc(size); in callArbitraryFunction() 46 ptr = osi_calloc(size); in callArbitraryFunction() 48 if (ptr) { in callArbitraryFunction() 49 alloc_vector->push_back(ptr); in callArbitraryFunction() 61 void* ptr = alloc_vector->at(index); in callArbitraryFunction() local 62 if (ptr) { in callArbitraryFunction() 64 osi_free(ptr); in callArbitraryFunction() 66 osi_free_and_reset(&ptr); in callArbitraryFunction()
|
/system/keymaster/android_keymaster/ |
D | keymaster_stl.cpp | 34 void __attribute__((weak)) operator delete(void* ptr) { in operator delete() argument 35 if (ptr) in operator delete() 36 free(ptr); in operator delete() 39 void __attribute__((weak)) operator delete[](void* ptr) { in operator delete[]() argument 40 if (ptr) in operator delete[]() 41 free(ptr); in operator delete[]()
|
/system/chre/apps/chqts/src/shared/ |
D | dumb_allocator_test.cc | 26 static void ExpectGoodAlloc(const DA &da, const void *ptr) { in ExpectGoodAlloc() argument 27 EXPECT_NE(nullptr, ptr); in ExpectGoodAlloc() 28 EXPECT_TRUE(da.contains(ptr)); in ExpectGoodAlloc() 33 void *ptr = da.alloc(kAllocSize); in TEST() local 34 ExpectGoodAlloc(da, ptr); in TEST() 35 EXPECT_TRUE(da.free(ptr)); in TEST() 66 uint8_t *ptr = static_cast<uint8_t*>(da.alloc(kAllocSize)); in TEST() local 67 ASSERT_NE(nullptr, ptr); in TEST() 68 EXPECT_FALSE(da.contains(ptr - 1)); in TEST() 69 EXPECT_FALSE(da.contains(ptr + 1)); in TEST()
|
D | dumb_allocator.h | 34 bool free(void *ptr); 35 bool contains(const void *ptr) const; 49 bool getSlot(const void *ptr, size_t *slot) const; 86 bool free(void *ptr) { in free() argument 87 return DumbAllocatorBase::free(ptr); in free() 94 bool contains(const void *ptr) const { in contains() argument 95 return DumbAllocatorBase::contains(ptr); in contains()
|
/system/chre/apps/chqts/src/general_test/ |
D | heap_alloc_stress_test.cc | 34 void *ptr = chreHeapAlloc(hugeSize); in tryAbsurdMalloc() local 35 if (ptr != NULL) { in tryAbsurdMalloc() 38 chreHeapFree(ptr); in tryAbsurdMalloc() 87 void *ptr = chreHeapAlloc(curr_alloc_size); in setUp() local 88 while (ptr == NULL) { in setUp() 93 ptr = chreHeapAlloc(curr_alloc_size); in setUp() 95 if (ptr == NULL) { in setUp() 99 ptrs[index] = ptr; in setUp()
|
/system/bt/embdrv/sbc/decoder/include/ |
D | oi_bitstream.h | 72 #define OI_BITSTREAM_GetWritePtr(bs) ((bs)->ptr.w - 3) 73 #define OI_BITSTREAM_GetReadPtr(bs) ((bs)->ptr.r - 3) 78 #define OI_BITSTREAM_READUINT(result, bits, ptr, value, bitPtr) \ argument 89 (value) = ((value) << 8) | *(ptr)++; \ 95 #define OI_BITSTREAM_WRITEUINT(ptr, value, bitPtr, datum, bits) \ argument 102 *(ptr)++ = (uint8_t)((value) >> 24); \ 107 #define OI_BITSTREAM_WRITEFLUSH(ptr, value, bitPtr) \ argument 111 *(ptr)++ = (uint8_t)((value) >> 24); \
|
/system/memory/libdmabufheap/tests/ |
D | dmabuf_heap_test.cpp | 103 void* ptr = NULL; in TEST_F() local 105 ptr = mmap(NULL, kAllocSizeInBytes, PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F() 106 ASSERT_TRUE(ptr != NULL); in TEST_F() 111 memset(ptr, 0xaa, kAllocSizeInBytes); in TEST_F() 116 ASSERT_EQ(0, munmap(ptr, kAllocSizeInBytes)); in TEST_F() 127 void* ptr = NULL; in TEST_F() local 128 ptr = mmap(NULL, kAllocSizeInBytes, PROT_READ, MAP_SHARED, map_fd, 0); in TEST_F() 129 ASSERT_TRUE(ptr != NULL); in TEST_F() 134 ASSERT_EQ(0, memcmp(ptr, zeroes_ptr.get(), kAllocSizeInBytes)); in TEST_F() 139 ASSERT_EQ(0, munmap(ptr, kAllocSizeInBytes)); in TEST_F() [all …]
|
D | dmabuf_heap_test.c | 43 unsigned char* ptr = NULL; in libdmabufheaptest() local 72 ptr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in libdmabufheaptest() 73 if (ptr == MAP_FAILED) { in libdmabufheaptest() 86 ptr[i] = (unsigned char)i; in libdmabufheaptest() 89 if (ptr[i] != (unsigned char)i) { in libdmabufheaptest() 92 __func__, i, ptr[i]); in libdmabufheaptest() 104 munmap(ptr, len); in libdmabufheaptest()
|
/system/core/libunwindstack/ |
D | Global.cpp | 83 uint64_t ptr; in FindAndReadVariable() local 84 if (elf->GetGlobalVariableOffset(variable, &ptr) && ptr != 0) { in FindAndReadVariable() 86 if (ptr >= info->offset && ptr < offset_end) { in FindAndReadVariable() 87 ptr = info->start + ptr - info->offset; in FindAndReadVariable() 88 if (ReadVariableData(ptr)) { in FindAndReadVariable()
|
/system/core/init/ |
D | tokenizer.cpp | 10 char *x = state->ptr; in next_token() 22 state->ptr = x; in next_token() 26 state->ptr = x; in next_token() 36 state->ptr = x+1; in next_token() 39 state->ptr = x; in next_token() 48 state->ptr = x; in next_token() 73 state->ptr = x; in next_token()
|
/system/connectivity/wificond/net/ |
D | nl80211_attribute.cpp | 73 const uint8_t* ptr = buf; in GetAttributeImpl() local 75 while (ptr + NLA_HDRLEN <= end_ptr) { in GetAttributeImpl() 76 const nlattr* header = reinterpret_cast<const nlattr*>(ptr); in GetAttributeImpl() 78 if (ptr + NLA_ALIGN(header->nla_len) > end_ptr) { in GetAttributeImpl() 83 *attr_start = const_cast<uint8_t*>(ptr); in GetAttributeImpl() 84 *attr_end = const_cast<uint8_t*>(ptr + NLA_ALIGN(header->nla_len)); in GetAttributeImpl() 88 ptr += NLA_ALIGN(header->nla_len); in GetAttributeImpl() 228 const uint8_t* ptr = data_.data() + NLA_HDRLEN; in GetListOfNestedAttributes() local 231 while (ptr + NLA_HDRLEN <= end_ptr) { in GetListOfNestedAttributes() 232 const nlattr* header = reinterpret_cast<const nlattr*>(ptr); in GetListOfNestedAttributes() [all …]
|
/system/media/audio_utils/include/audio_utils/ |
D | sndfile.h | 71 sf_count_t sf_readf_short(SNDFILE *handle, int16_t *ptr, sf_count_t desired); 72 sf_count_t sf_readf_float(SNDFILE *handle, float *ptr, sf_count_t desired); 73 sf_count_t sf_readf_int(SNDFILE *handle, int *ptr, sf_count_t desired); 79 sf_count_t sf_writef_short(SNDFILE *handle, const int16_t *ptr, sf_count_t desired); 80 sf_count_t sf_writef_float(SNDFILE *handle, const float *ptr, sf_count_t desired); 81 sf_count_t sf_writef_int(SNDFILE *handle, const int *ptr, sf_count_t desired);
|
/system/extras/memory_replay/traces/ |
D | README | 9 <tid>: <action_name> <ptr> [<optional_arguments>] 26 <tid>: malloc <ptr> <size> 27 Allocation made by malloc(<size>). <ptr> is the value returned by malloc. 33 <tid>: calloc <ptr> <nmemb> <size> 34 Allocation made by calloc(<nmemb>, <size>. <ptr> is the value returned 50 <tid>:memalign <ptr> <alignment> <size> 51 Allocation made by memalign(<alignment>, <size>). <ptr> is the value 58 <tid>: free <ptr> 59 Find a previously allocated pointer <ptr> and call free(<ptr>). 60 <ptr> can be 0x0 to indicate the freeing of a nullptr.
|
/system/chre/core/tests/ |
D | memory_manager_test.cc | 40 void *ptr = manager.nanoappAlloc(&app, 1); in TEST() local 41 EXPECT_NE(ptr, nullptr); in TEST() 44 manager.nanoappFree(&app, ptr); in TEST() 60 void *ptr = manager.nanoappAlloc(&app, 0); in TEST() local 61 EXPECT_EQ(ptr, nullptr); in TEST() 69 void *ptr = manager.nanoappAlloc(&app, manager.getMaxAllocationBytes() + 1); in TEST() local 70 EXPECT_EQ(ptr, nullptr); in TEST() 103 void *ptr = manager.nanoappAlloc(&app, -1); in TEST() local 104 EXPECT_EQ(ptr, nullptr); in TEST()
|
/system/core/fs_mgr/libfiemap/ |
D | fiemap_writer_test.cpp | 137 auto ptr = FiemapWriter::Open(testfile, gBlockSize, true, std::move(callback)); in TEST_F() local 138 EXPECT_NE(ptr, nullptr); in TEST_F() 143 auto ptr = FiemapWriter::Open(testfile, 4096); in TEST_F() local 144 ASSERT_NE(ptr, nullptr); in TEST_F() 185 auto ptr = FiemapWriter::Open(testfile, 0, false); in TEST_F() local 186 ASSERT_NE(ptr, nullptr); in TEST_F() 187 EXPECT_GT(ptr->extents().size(), 0); in TEST_F() 193 auto ptr = FiemapWriter::Open(testfile, gBlockSize, true, std::move(callback)); in TEST_F() local 194 EXPECT_EQ(ptr, nullptr); in TEST_F() 261 auto ptr = SplitFiemap::Create(testfile, 1024 * 768, 1024 * 32); in TEST_F() local [all …]
|