Home
last modified time | relevance | path

Searched refs:ptr (Results 1 – 25 of 213) sorted by relevance

123456789

/system/tools/mkbootimg/rust/
Dbootimg_priv.rs56 let ptr = UNINIT.as_ptr(); in bindgen_test_layout_boot_img_hdr_v0() localVariable
68 unsafe { ::core::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
73 unsafe { ::core::ptr::addr_of!((*ptr).kernel_size) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
78 unsafe { ::core::ptr::addr_of!((*ptr).kernel_addr) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
83 unsafe { ::core::ptr::addr_of!((*ptr).ramdisk_size) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
88 unsafe { ::core::ptr::addr_of!((*ptr).ramdisk_addr) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
93 unsafe { ::core::ptr::addr_of!((*ptr).second_size) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
98 unsafe { ::core::ptr::addr_of!((*ptr).second_addr) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
103 unsafe { ::core::ptr::addr_of!((*ptr).tags_addr) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
108 unsafe { ::core::ptr::addr_of!((*ptr).page_size) as usize - ptr as usize }, in bindgen_test_layout_boot_img_hdr_v0()
[all …]
/system/chre/util/tests/
Dshared_ptr_test.cc52 chre::SharedPtr<TestBase> ptr; in TEST_F() local
54 EXPECT_TRUE(ptr.isNull()); in TEST_F()
58 chre::SharedPtr<TestBase> ptr = chre::MakeShared<TestBase>(); in TEST_F() local
60 EXPECT_FALSE(ptr.isNull()); in TEST_F()
64 chre::SharedPtr<TestBase> ptr = chre::MakeShared<TestBase>(); in TEST_F() local
66 chre::SharedPtr<TestBase> movedPtr(std::move(ptr)); in TEST_F()
68 EXPECT_TRUE(ptr.isNull()); in TEST_F()
73 chre::SharedPtr<TestBase> ptr = chre::MakeShared<TestBase>(); in TEST_F() local
75 chre::SharedPtr<TestBase> copiedPtr(ptr); in TEST_F()
77 EXPECT_FALSE(ptr.isNull()); in TEST_F()
[all …]
/system/memory/libion/tests/
Dmap_test.cpp39 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 …]
Dexit_test.cpp87 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/
DAllocator.cpp73 void operator delete(void* ptr);
76 void Free(void* ptr);
90 void MapFree(void* ptr);
92 void FreeLocked(void* ptr);
95 void* ptr; member
129 void* ptr = mmap(NULL, map_size, prot, flags, -1, 0); in MapAligned() local
130 if (ptr == MAP_FAILED) { in MapAligned()
135 void* aligned_ptr = ptr; in MapAligned()
140 if (aligned_ptr != ptr) { in MapAligned()
141 ptrdiff_t extra = reinterpret_cast<uintptr_t>(aligned_ptr) - reinterpret_cast<uintptr_t>(ptr); in MapAligned()
[all …]
/system/memory/libmemunreachable/tests/
DDisableMalloc_test.cpp66 void* ptr = malloc(128); in TEST_F()
67 ASSERT_NE(ptr, nullptr); in TEST_F()
68 free(ptr); in TEST_F()
72 void* ptr = malloc(128); in TEST_F()
73 ASSERT_NE(ptr, nullptr); in TEST_F()
74 free(ptr); in TEST_F()
86 void* ptr = ::operator new(1); in TEST_F()
87 ASSERT_NE(ptr, nullptr); in TEST_F()
88 ::operator delete(ptr); in TEST_F()
92 void* ptr = ::operator new(1); in TEST_F()
[all …]
DAllocator_test.cpp43 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/extras/memory_replay/
DTraceBenchmark.cpp60 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/chre/apps/nearby/third_party/nanopb/
Dpb.h253 const void *ptr; member
389 #define pb_realloc(ptr, size) realloc(ptr, size) argument
392 #define pb_free(ptr) free(ptr) argument
429 #define PB_REQUIRED_STATIC(tag, st, m, fd, ltype, ptr) \ argument
432 pb_membersize(st, m), 0, ptr \
436 #define PB_OPTIONAL_STATIC(tag, st, m, fd, ltype, ptr) \ argument
439 pb_delta(st, has_##m, m), pb_membersize(st, m), 0, ptr \
442 #define PB_SINGULAR_STATIC(tag, st, m, fd, ltype, ptr) \ argument
445 pb_membersize(st, m), 0, ptr \
450 #define PB_REPEATED_STATIC(tag, st, m, fd, ltype, ptr) \ argument
[all …]
/system/chre/chpp/platform/linux/
Dmemory.c37 void *ptr = NULL; in chppMalloc() local
39 ptr = malloc(sizeof(struct ChppAllocHeader) + size); in chppMalloc()
41 if (ptr != NULL) { in chppMalloc()
42 struct ChppAllocHeader *header = (struct ChppAllocHeader *)ptr; in chppMalloc()
45 ptr = header; in chppMalloc()
56 return ptr; in chppMalloc()
59 void chppFree(void *ptr) { in chppFree() argument
60 if (ptr != NULL) { in chppFree()
61 struct ChppAllocHeader *header = (struct ChppAllocHeader *)ptr; in chppFree()
77 void *ptr = NULL; in chppRealloc() local
[all …]
/system/libvintf/
DVintfObjectUtils.h34 std::shared_ptr<const T> Get(const char* id, LockedSharedPtr<T>* ptr, const F& fetch,
36 std::unique_lock<std::mutex> lock(ptr->mutex);
39 if (ptr->object && ptr->lastModified != lastModified) {
41 ptr->object = nullptr;
43 if (!ptr->object) {
45 ptr->object = std::make_unique<T>();
46 ptr->lastModified = lastModified;
48 status_t status = fetch(ptr->object.get(), &error);
56 ptr->object = nullptr; // frees the old object
59 return ptr->object;
/system/media/audio_utils/
Dtinysndfile.c39 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/
Dion_test.c78 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/chre/util/include/chre/util/
Dcontainer_support.h53 void *ptr; in memoryAlignedAlloc() local
54 int result = posix_memalign(&ptr, alignof(T), sizeof(T)); in memoryAlignedAlloc()
56 ptr = nullptr; in memoryAlignedAlloc()
58 return static_cast<T *>(ptr); in memoryAlignedAlloc()
90 void *ptr; in memoryAlignedAlloc() local
91 int result = posix_memalign(&ptr, alignof(T), sizeof(T)); in memoryAlignedAlloc()
93 ptr = nullptr; in memoryAlignedAlloc()
95 return static_cast<T *>(ptr); in memoryAlignedAlloc()
/system/chre/platform/shared/mbedtls/
Dmbedtls_memory.cc28 void *ptr = chre::memoryAlloc(totalSize); in mbedtlsMemoryCalloc() local
29 if (ptr != nullptr) { in mbedtlsMemoryCalloc()
30 memset(ptr, 0, totalSize); in mbedtlsMemoryCalloc()
32 return ptr; in mbedtlsMemoryCalloc()
35 void mbedtlsMemoryFree(void *ptr) { in mbedtlsMemoryFree() argument
36 chre::memoryFree(ptr); in mbedtlsMemoryFree()
/system/chre/apps/test/chqts/src/shared/
Dchunk_allocator_test.cc26 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()
Dchunk_allocator.h34 bool free(void *ptr);
35 bool contains(const void *ptr) const;
49 bool getSlot(const void *ptr, size_t *slot) const;
85 bool free(void *ptr) { in free() argument
86 return ChunkAllocatorBase::free(ptr); in free()
93 bool contains(const void *ptr) const { in contains() argument
94 return ChunkAllocatorBase::contains(ptr); in contains()
/system/chre/apps/test/chqts/src/general_test/
Dheap_alloc_stress_test.cc34 void *ptr = chreHeapAlloc(hugeSize); in tryAbsurdMalloc() local
35 if (ptr != NULL) { in tryAbsurdMalloc()
38 chreHeapFree(ptr); in tryAbsurdMalloc()
83 void *ptr = chreHeapAlloc(curr_alloc_size); in setUp() local
84 while (ptr == NULL) { in setUp()
89 ptr = chreHeapAlloc(curr_alloc_size); in setUp()
91 if (ptr == NULL) { in setUp()
95 ptrs[index] = ptr; in setUp()
/system/memory/libdmabufheap/tests/
Ddmabuf_heap_test.cpp41 void* ptr = mmap(NULL, kAllocSizeInBytes, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in DoAlloc() local
42 ASSERT_TRUE(ptr != MAP_FAILED); in DoAlloc()
50 ASSERT_EQ(0, munmap(ptr, kAllocSizeInBytes)); in DoAlloc()
184 void* ptr = mmap(NULL, kAllocSizeInBytes, PROT_WRITE, MAP_SHARED, map_fd, 0); in TEST_F() local
185 ASSERT_TRUE(ptr != MAP_FAILED); in TEST_F()
190 memset(ptr, 0xaa, kAllocSizeInBytes); in TEST_F()
195 ASSERT_EQ(0, munmap(ptr, kAllocSizeInBytes)); in TEST_F()
206 void* ptr = mmap(NULL, kAllocSizeInBytes, PROT_READ, MAP_SHARED, map_fd, 0); in TEST_F() local
207 ASSERT_TRUE(ptr != MAP_FAILED); in TEST_F()
212 ASSERT_EQ(0, memcmp(ptr, zeroes_ptr.get(), kAllocSizeInBytes)); in TEST_F()
[all …]
/system/unwinding/libunwindstack/
DGlobal.cpp85 uint64_t ptr; in FindAndReadVariable() local
86 if (elf->GetGlobalVariableOffset(variable, &ptr) && ptr != 0) { in FindAndReadVariable()
88 if (ptr >= info->offset() && ptr < offset_end) { in FindAndReadVariable()
89 ptr = info->start() + ptr - info->offset(); in FindAndReadVariable()
90 if (ReadVariableData(ptr)) { in FindAndReadVariable()
/system/connectivity/wificond/net/
Dnl80211_attribute.cpp73 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/core/init/
Dtokenizer.cpp10 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/tools/aidl/
Dcode_writer_unittest.cpp31 CodeWriterPtr ptr = CodeWriter::ForString(&str); in TEST() local
32 CodeWriter& writer = *ptr; in TEST()
40 CodeWriterPtr ptr = CodeWriter::ForString(&str); in TEST() local
41 CodeWriter& writer = *ptr; in TEST()
52 CodeWriterPtr ptr = CodeWriter::ForString(&str); in TEST() local
53 CodeWriter& writer = *ptr; in TEST()
/system/extras/memory_replay/traces/
DREADME9 <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/core/fs_mgr/libfiemap/
Dfiemap_writer_test.cpp144 auto ptr = FiemapWriter::Open(testfile, gBlockSize, true, std::move(callback)); in TEST_F() local
145 EXPECT_NE(ptr, nullptr); in TEST_F()
150 auto ptr = FiemapWriter::Open(testfile, 4096); in TEST_F() local
151 ASSERT_NE(ptr, nullptr); in TEST_F()
192 auto ptr = FiemapWriter::Open(testfile, 0, false); in TEST_F() local
193 ASSERT_NE(ptr, nullptr); in TEST_F()
194 EXPECT_GT(ptr->extents().size(), 0); in TEST_F()
200 auto ptr = FiemapWriter::Open(testfile, gBlockSize, true, std::move(callback)); in TEST_F() local
201 EXPECT_EQ(ptr, nullptr); in TEST_F()
275 auto ptr = SplitFiemap::Create(testfile, 1024 * 768, 1024 * 32); in TEST_F() local
[all …]

123456789