Home
last modified time | relevance | path

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

123

/bionic/tests/
Dmalloc_test.cpp31 void *ptr = malloc(100); in TEST() local
32 ASSERT_TRUE(ptr != NULL); in TEST()
33 ASSERT_LE(100U, malloc_usable_size(ptr)); in TEST()
34 free(ptr); in TEST()
46 char *ptr = (char *)calloc(1, alloc_len); in TEST() local
47 ASSERT_TRUE(ptr != NULL); in TEST()
48 ASSERT_LE(alloc_len, malloc_usable_size(ptr)); in TEST()
50 ASSERT_EQ(0, ptr[i]); in TEST()
52 free(ptr); in TEST()
80 char *ptr = reinterpret_cast<char*>(memalign(alignment, 100)); in TEST() local
[all …]
Dstring_test.cpp202 Character *ptr, *ptr1, *ptr2; member in StringTestState
230 ptr = ptr1 = ptr2 = nullptr; in ResetPointers()
232 ptr = glob_ptr + alignments[align1_index_]; in ResetPointers()
251 memcpy(state.ptr, state.ptr2, 2 * state.MAX_LEN); in TEST()
257 strcpy(state.ptr + state.MAX_LEN - 1, state.ptr1); in TEST()
260 EXPECT_TRUE(memcmp(state.ptr, state.ptr2, 2 * state.MAX_LEN) == 0); in TEST()
500 memcpy(state.ptr, state.ptr1, state.MAX_LEN); in TEST()
505 memset(state.ptr + state.MAX_LEN, '\1', state.MAX_LEN); in TEST()
506 memcpy(state.ptr + state.MAX_LEN, state.ptr1, pos + 1); in TEST()
507 state.ptr[2 * state.MAX_LEN - 1] = '\0'; in TEST()
[all …]
/bionic/libc/arch-arm/bionic/
Datomics_arm.c61 __atomic_cmpxchg(int old, int _new, volatile int *ptr) in __atomic_cmpxchg() argument
64 return __sync_val_compare_and_swap(ptr, old, _new) != old; in __atomic_cmpxchg()
68 __atomic_swap(int _new, volatile int *ptr) in __atomic_swap() argument
72 prev = *ptr; in __atomic_swap()
73 } while (__sync_val_compare_and_swap(ptr, prev, _new) != prev); in __atomic_swap()
78 __atomic_dec(volatile int *ptr) in __atomic_dec() argument
80 return __sync_fetch_and_sub (ptr, 1); in __atomic_dec()
84 __atomic_inc(volatile int *ptr) in __atomic_inc() argument
86 return __sync_fetch_and_add (ptr, 1); in __atomic_inc()
/bionic/libc/include/android/
Dlegacy_sys_atomics_inlines.h49 __ATOMIC_INLINE__ int __atomic_cmpxchg(int old, int _new, volatile int *ptr) { in __atomic_cmpxchg() argument
51 return __sync_val_compare_and_swap(ptr, old, _new) != old; in __atomic_cmpxchg()
54 __ATOMIC_INLINE__ int __atomic_swap(int _new, volatile int *ptr) { in __atomic_swap() argument
57 prev = *ptr; in __atomic_swap()
58 } while (__sync_val_compare_and_swap(ptr, prev, _new) != prev); in __atomic_swap()
62 __ATOMIC_INLINE__ int __atomic_dec(volatile int *ptr) { in __atomic_dec() argument
63 return __sync_fetch_and_sub(ptr, 1); in __atomic_dec()
66 __ATOMIC_INLINE__ int __atomic_inc(volatile int *ptr) { in __atomic_inc() argument
67 return __sync_fetch_and_add(ptr, 1); in __atomic_inc()
/bionic/libc/bionic/
Dnew.cpp41 void operator delete(void* ptr) throw() { in operator delete() argument
42 free(ptr); in operator delete()
45 void operator delete[](void* ptr) throw() { in operator delete[]() argument
46 free(ptr); in operator delete[]()
57 void operator delete(void* ptr, const std::nothrow_t&) throw() { in operator delete() argument
58 free(ptr); in operator delete()
61 void operator delete[](void* ptr, const std::nothrow_t&) throw() { in operator delete[]() argument
62 free(ptr); in operator delete[]()
D__cmsg_nxthdr.cpp32 cmsghdr* ptr; in __cmsg_nxthdr() local
33 ptr = reinterpret_cast<cmsghdr*>(reinterpret_cast<char*>(cmsg) + CMSG_ALIGN(cmsg->cmsg_len)); in __cmsg_nxthdr()
34 size_t len = reinterpret_cast<char*>(ptr+1) - reinterpret_cast<char*>(msg->msg_control); in __cmsg_nxthdr()
38 return ptr; in __cmsg_nxthdr()
Dmalloc_debug_qemu.cpp90 void* ptr; member
142 const void* ptr; member
177 void* ptr; member
373 return static_cast<char*>(desc->ptr) + desc->prefix_size; in mallocdesc_user_ptr()
394 return static_cast<char*>(desc->ptr) + mallocdesc_alloc_size(desc); in mallocdesc_alloc_end()
456 free_desc.ptr = ptr_to_free; in notify_qemu_free()
477 static inline int query_qemu_malloc_info(const void* ptr, MallocDesc* desc, uint32_t routine) { in query_qemu_malloc_info() argument
480 query.ptr = ptr; in query_qemu_malloc_info()
543 mallocdesc_user_ptr(desc), desc->ptr, in dump_malloc_descriptor()
558 volatile char* prefix = (volatile char*)desc->ptr; in test_access_violation()
[all …]
Dmalloc_debug_check.cpp385 uintptr_t ptr = reinterpret_cast<uintptr_t>(user(reinterpret_cast<hdr_t*>(base))); in chk_memalign() local
386 if ((ptr % alignment) != 0) { in chk_memalign()
388 ptr += ((-ptr) % alignment); in chk_memalign()
391 hdr_t* hdr = meta(reinterpret_cast<void*>(ptr)); in chk_memalign()
400 extern "C" void chk_free(void* ptr) { in chk_free() argument
403 return g_malloc_dispatch->free(ptr); in chk_free()
406 if (!ptr) /* ignore free(NULL) */ in chk_free()
409 hdr_t* hdr = meta(ptr); in chk_free()
442 extern "C" void* chk_realloc(void* ptr, size_t bytes) { in chk_realloc() argument
445 return g_malloc_dispatch->realloc(ptr, bytes); in chk_realloc()
[all …]
/bionic/libc/dns/include/
Dhostent.h67 #define HENT_ARRAY(dst, anum, ptr, len) \ argument
72 dst = (void *)ptr; \
73 ptr += _len; \
77 #define HENT_COPY(dst, src, slen, ptr, len) \ argument
81 memcpy(ptr, src, (size_t)slen); \
82 dst = ptr; \
83 ptr += slen; \
87 #define HENT_SCOPY(dst, src, ptr, len) \ argument
90 HENT_COPY(dst, src, _len, ptr, len); \
/bionic/libc/upstream-netbsd/lib/libc/stdlib/
Dreallocarr.c57 reallocarr(void *ptr, size_t number, size_t size) in __weak_alias()
64 memcpy(&optr, ptr, sizeof(ptr)); in __weak_alias()
68 memcpy(ptr, &nptr, sizeof(ptr)); in __weak_alias()
90 memcpy(ptr, &nptr, sizeof(ptr)); in __weak_alias()
/bionic/linker/
Dlinker_allocator.h78 void* ptr = mmap(const_cast<T*>(hint), size, variable
80 if (ptr == MAP_FAILED) {
86 prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, "linker_alloc_vector");
88 return reinterpret_cast<T*>(ptr);
91 void deallocate(T* ptr, size_t n) { in deallocate() argument
92 munmap(ptr, n * sizeof(T)); in deallocate()
106 void free(void* ptr);
112 linker_vector_t::iterator find_page_record(void* ptr);
132 void* realloc(void* ptr, size_t size);
133 void free(void* ptr);
[all …]
Dlinker_allocator.cpp131 void LinkerSmallObjectAllocator::free(void* ptr) { in free() argument
132 auto page_record = find_page_record(ptr); in free()
134 ssize_t offset = reinterpret_cast<uintptr_t>(ptr) - sizeof(page_info); in free()
137 __libc_fatal("invalid pointer: %p (block_size=%zd)", ptr, block_size_); in free()
140 memset(ptr, 0, block_size_); in free()
141 small_object_block_record* block_record = reinterpret_cast<small_object_block_record*>(ptr); in free()
165 linker_vector_t::iterator LinkerSmallObjectAllocator::find_page_record(void* ptr) { in find_page_record() argument
166 void* addr = reinterpret_cast<void*>(PAGE_START(reinterpret_cast<uintptr_t>(ptr))); in find_page_record()
174 __libc_fatal("page record for %p was not found (block_size=%zd)", ptr, block_size_); in find_page_record()
277 page_info* LinkerMemoryAllocator::get_page_info(void* ptr) { in get_page_info() argument
[all …]
Dlinker_memory.cpp35 void free(void* ptr) { in free() argument
36 g_linker_allocator.free(ptr); in free()
/bionic/libc/private/
DUniquePtr.h51 explicit UniquePtr(T* ptr = nullptr) : mPtr(ptr) { }
78 void reset(T* ptr = nullptr) {
79 if (ptr != mPtr) {
81 mPtr = ptr;
103 explicit UniquePtr(T* ptr = NULL) : mPtr(ptr) {
125 void reset(T* ptr = NULL) {
126 if (ptr != mPtr) {
128 mPtr = ptr;
/bionic/libc/arch-x86_64/bionic/
D__set_tls.c35 __LIBC_HIDDEN__ int __set_tls(void* ptr) { in __set_tls() argument
36 return __arch_prctl(ARCH_SET_FS, (uintptr_t) ptr); in __set_tls()
/bionic/tests/libs/
Ddlopen_nodelete_dt_flags_1.cpp22 extern "C" void dlopen_nodelete_dt_flags_1_set_unload_flag_ptr(bool* ptr) { in dlopen_nodelete_dt_flags_1_set_unload_flag_ptr() argument
23 unload_flag_ptr = ptr; in dlopen_nodelete_dt_flags_1_set_unload_flag_ptr()
Ddlopen_nodelete_1.cpp23 extern "C" void dlopen_nodelete_1_set_unload_flag_ptr(bool* ptr) { in dlopen_nodelete_1_set_unload_flag_ptr() argument
24 unload_flag_ptr = ptr; in dlopen_nodelete_1_set_unload_flag_ptr()
Ddlopen_nodelete_2.cpp23 extern "C" void dlopen_nodelete_2_set_unload_flag_ptr(bool* ptr) { in dlopen_nodelete_2_set_unload_flag_ptr() argument
24 unload_flag_ptr = ptr; in dlopen_nodelete_2_set_unload_flag_ptr()
/bionic/libc/dns/net/
Dsethostent.c131 char *buf, *ptr; in _hf_gethtbyname2() local
147 if ((ptr = buf = malloc(len = info->buflen)) == NULL) { in _hf_gethtbyname2()
183 HENT_SCOPY(hent.h_name, hp->h_name, ptr, len); in _hf_gethtbyname2()
188 ptr, len); in _hf_gethtbyname2()
190 ptr = (void *)ALIGN(ptr); in _hf_gethtbyname2()
191 if ((size_t)(ptr - buf) >= info->buflen) in _hf_gethtbyname2()
197 HENT_COPY(addr_ptrs[num], hp->h_addr_list[0], hp->h_length, ptr, in _hf_gethtbyname2()
210 ptr = info->buf; in _hf_gethtbyname2()
216 HENT_ARRAY(hp->h_aliases, anum, ptr, len); in _hf_gethtbyname2()
217 HENT_ARRAY(hp->h_addr_list, num, ptr, len); in _hf_gethtbyname2()
[all …]
/bionic/libc/kernel/uapi/linux/mmc/
Dioctl.h42 #define mmc_ioc_cmd_set_data(ic,ptr) ic.data_ptr = (__u64) (unsigned long) ptr argument
/bionic/libc/dns/nameser/
Dns_parse.c80 ns_skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) { in ns_skiprr() argument
81 const u_char *optr = ptr; in ns_skiprr()
86 b = dn_skipname(ptr, eom); in ns_skiprr()
89 ptr += b/*Name*/ + NS_INT16SZ/*Type*/ + NS_INT16SZ/*Class*/; in ns_skiprr()
91 if (ptr + NS_INT32SZ + NS_INT16SZ > eom) in ns_skiprr()
93 ptr += NS_INT32SZ/*TTL*/; in ns_skiprr()
94 NS_GET16(rdlength, ptr); in ns_skiprr()
95 ptr += rdlength/*RData*/; in ns_skiprr()
98 if (ptr > eom) in ns_skiprr()
100 _DIAGASSERT(__type_fit(int, ptr - optr)); in ns_skiprr()
[all …]
/bionic/libc/arch-x86/bionic/
D__set_tls.c60 __LIBC_HIDDEN__ int __set_tls(void* ptr) { in __set_tls() argument
62 __init_user_desc(&tls_descriptor, true, ptr); in __set_tls()
/bionic/libc/dns/resolv/
Dres_comp.c132 dn_skipname(const u_char *ptr, const u_char *eom) { in dn_skipname() argument
133 const u_char *saveptr = ptr; in dn_skipname()
135 if (ns_name_skip(&ptr, eom) == -1) in dn_skipname()
137 return (ptr - saveptr); in dn_skipname()
/bionic/libc/upstream-netbsd/lib/libc/regex/
Dregex2.h158 uch *ptr; /* -> uch [csetsize] */ member
165 #define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c))
166 #define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c))
167 #define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask)
/bionic/libc/kernel/uapi/linux/
Dbinder.h99 binder_uintptr_t ptr; member
115 } ptr; member
121 binder_uintptr_t ptr; member
137 binder_uintptr_t ptr; member

123