/bionic/benchmarks/ |
D | math_benchmark.cpp | 27 static void SetLabel(benchmark::State& state) { in SetLabel() argument 28 state.SetLabel(names[state.range(0)]); in SetLabel() 35 static void BM_math_sqrt(benchmark::State& state) { in BM_math_sqrt() argument 38 while (state.KeepRunning()) { in BM_math_sqrt() 44 static void BM_math_log10(benchmark::State& state) { in BM_math_log10() argument 47 while (state.KeepRunning()) { in BM_math_log10() 53 static void BM_math_logb(benchmark::State& state) { in BM_math_logb() argument 56 while (state.KeepRunning()) { in BM_math_logb() 62 static void BM_math_isfinite_macro(benchmark::State& state) { in BM_math_isfinite_macro() argument 64 v = values[state.range(0)]; in BM_math_isfinite_macro() [all …]
|
D | pthread_benchmark.cpp | 24 static void BM_pthread_self(benchmark::State& state) { in BM_pthread_self() argument 25 while (state.KeepRunning()) { in BM_pthread_self() 31 static void BM_pthread_getspecific(benchmark::State& state) { in BM_pthread_getspecific() argument 35 while (state.KeepRunning()) { in BM_pthread_getspecific() 43 static void BM_pthread_setspecific(benchmark::State& state) { in BM_pthread_setspecific() argument 47 while (state.KeepRunning()) { in BM_pthread_setspecific() 58 static void BM_pthread_once(benchmark::State& state) { in BM_pthread_once() argument 62 while (state.KeepRunning()) { in BM_pthread_once() 68 static void BM_pthread_mutex_lock(benchmark::State& state) { in BM_pthread_mutex_lock() argument 71 while (state.KeepRunning()) { in BM_pthread_mutex_lock() [all …]
|
D | string_benchmark.cpp | 43 static void BM_string_memcmp(benchmark::State& state) { in BM_string_memcmp() argument 44 const size_t nbytes = state.range(0); in BM_string_memcmp() 45 const size_t src_alignment = state.range(1); in BM_string_memcmp() 46 const size_t dst_alignment = state.range(2); in BM_string_memcmp() 54 while (state.KeepRunning()) { in BM_string_memcmp() 58 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes)); in BM_string_memcmp() 62 static void BM_string_memcpy(benchmark::State& state) { in BM_string_memcpy() argument 63 const size_t nbytes = state.range(0); in BM_string_memcpy() 64 const size_t src_alignment = state.range(1); in BM_string_memcpy() 65 const size_t dst_alignment = state.range(2); in BM_string_memcpy() [all …]
|
D | stdio_benchmark.cpp | 30 void ReadWriteTest(benchmark::State& state, Fn f, bool buffered) { in ReadWriteTest() argument 31 size_t chunk_size = state.range(0); in ReadWriteTest() 41 while (state.KeepRunning()) { in ReadWriteTest() 45 state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(chunk_size)); in ReadWriteTest() 50 void BM_stdio_fread(benchmark::State& state) { in BM_stdio_fread() argument 51 ReadWriteTest(state, fread, true); in BM_stdio_fread() 55 void BM_stdio_fwrite(benchmark::State& state) { in BM_stdio_fwrite() argument 56 ReadWriteTest(state, fwrite, true); in BM_stdio_fwrite() 60 void BM_stdio_fread_unbuffered(benchmark::State& state) { in BM_stdio_fread_unbuffered() argument 61 ReadWriteTest(state, fread, false); in BM_stdio_fread_unbuffered() [all …]
|
D | time_benchmark.cpp | 24 static void BM_time_clock_gettime(benchmark::State& state) { in BM_time_clock_gettime() argument 26 while (state.KeepRunning()) { in BM_time_clock_gettime() 32 static void BM_time_clock_gettime_syscall(benchmark::State& state) { in BM_time_clock_gettime_syscall() argument 34 while (state.KeepRunning()) { in BM_time_clock_gettime_syscall() 40 static void BM_time_gettimeofday(benchmark::State& state) { in BM_time_gettimeofday() argument 42 while (state.KeepRunning()) { in BM_time_gettimeofday() 48 void BM_time_gettimeofday_syscall(benchmark::State& state) { in BM_time_gettimeofday_syscall() argument 50 while (state.KeepRunning()) { in BM_time_gettimeofday_syscall() 56 void BM_time_time(benchmark::State& state) { in BM_time_time() argument 57 while (state.KeepRunning()) { in BM_time_time() [all …]
|
D | atomic_benchmark.cpp | 46 void BM_empty(benchmark::State& state) { in BM_empty() argument 47 while (state.KeepRunning()) { in BM_empty() 53 static void BM_load_relaxed(benchmark::State& state) { in BM_load_relaxed() argument 55 while (state.KeepRunning()) { in BM_load_relaxed() 63 static void BM_load_acquire(benchmark::State& state) { in BM_load_acquire() argument 65 while (state.KeepRunning()) { in BM_load_acquire() 73 static void BM_store_release(benchmark::State& state) { in BM_store_release() argument 75 while (state.KeepRunning()) { in BM_store_release() 82 static void BM_store_seq_cst(benchmark::State& state) { in BM_store_seq_cst() argument 84 while (state.KeepRunning()) { in BM_store_seq_cst() [all …]
|
D | unistd_benchmark.cpp | 22 static void BM_unistd_getpid(benchmark::State& state) { in BM_unistd_getpid() argument 23 while (state.KeepRunning()) { in BM_unistd_getpid() 29 static void BM_unistd_getpid_syscall(benchmark::State& state) { in BM_unistd_getpid_syscall() argument 30 while (state.KeepRunning()) { in BM_unistd_getpid_syscall() 41 static void BM_unistd_gettid(benchmark::State& state) { in BM_unistd_gettid() argument 42 while (state.KeepRunning()) { in BM_unistd_gettid() 50 void BM_unistd_gettid_syscall(benchmark::State& state) { in BM_unistd_gettid_syscall() argument 51 while (state.KeepRunning()) { in BM_unistd_gettid_syscall()
|
D | semaphore_benchmark.cpp | 25 static void BM_semaphore_sem_getvalue(benchmark::State& state) { in BM_semaphore_sem_getvalue() argument 29 while (state.KeepRunning()) { in BM_semaphore_sem_getvalue() 36 static void BM_semaphore_sem_wait_sem_post(benchmark::State& state) { in BM_semaphore_sem_wait_sem_post() argument 40 while (state.KeepRunning()) { in BM_semaphore_sem_wait_sem_post() 122 BENCHMARK_F(SemaphoreFixture, semaphore_sem_post)(benchmark::State& state) { in BENCHMARK_F() 123 while (state.KeepRunning()) { in BENCHMARK_F() 124 state.PauseTiming(); in BENCHMARK_F() 146 state.ResumeTiming(); in BENCHMARK_F()
|
D | property_benchmark.cpp | 137 static void BM_property_get(benchmark::State& state) { in BM_property_get() argument 138 const size_t nprops = state.range(0); in BM_property_get() 143 while (state.KeepRunning()) { in BM_property_get() 150 static void BM_property_find(benchmark::State& state) { in BM_property_find() argument 151 const size_t nprops = state.range(0); in BM_property_find() 156 while (state.KeepRunning()) { in BM_property_find() 162 static void BM_property_read(benchmark::State& state) { in BM_property_read() argument 163 const size_t nprops = state.range(0); in BM_property_read() 176 while (state.KeepRunning()) { in BM_property_read() 185 static void BM_property_serial(benchmark::State& state) { in BM_property_serial() argument [all …]
|
/bionic/tests/ |
D | string_test.cpp | 256 StringTestState<char> state(SMALL); in TEST() local 257 for (size_t i = 1; i < state.n; i++) { in TEST() 258 for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) { in TEST() 259 memset(state.ptr2, '\2', state.MAX_LEN); in TEST() 260 state.ptr2[state.MAX_LEN - 1] = '\0'; in TEST() 261 memcpy(state.ptr, state.ptr2, 2 * state.MAX_LEN); in TEST() 263 memset(state.ptr1, 'L', state.len[i]); in TEST() 264 state.ptr1[random() % state.len[i]] = '\0'; in TEST() 265 state.ptr1[state.len[i] - 1] = '\0'; in TEST() 267 strcpy(state.ptr + state.MAX_LEN - 1, state.ptr1); in TEST() [all …]
|
/bionic/libc/bionic/ |
D | grp_pwd.cpp | 63 static void init_group_state(group_state_t* state) { in init_group_state() argument 64 memset(state, 0, sizeof(group_state_t) - sizeof(state->getgrent_idx)); in init_group_state() 65 state->group_.gr_mem = state->group_members_; in init_group_state() 136 static passwd* android_iinfo_to_passwd(passwd_state_t* state, in android_iinfo_to_passwd() argument 138 snprintf(state->name_buffer_, sizeof(state->name_buffer_), "%s", iinfo->name); in android_iinfo_to_passwd() 139 snprintf(state->dir_buffer_, sizeof(state->dir_buffer_), "/"); in android_iinfo_to_passwd() 140 snprintf(state->sh_buffer_, sizeof(state->sh_buffer_), "/system/bin/sh"); in android_iinfo_to_passwd() 142 passwd* pw = &state->passwd_; in android_iinfo_to_passwd() 143 pw->pw_name = state->name_buffer_; in android_iinfo_to_passwd() 146 pw->pw_dir = state->dir_buffer_; in android_iinfo_to_passwd() [all …]
|
D | mbrtoc16.cpp | 36 static inline bool mbspartialc16(const mbstate_t* state) { in mbspartialc16() argument 37 return mbstate_get_byte(state, 3) != 0; in mbspartialc16() 41 size_t nconv, mbstate_t* state) { in begin_surrogate() argument 45 mbstate_set_byte(state, 0, trail & 0x00ff); in begin_surrogate() 46 mbstate_set_byte(state, 1, (trail & 0xff00) >> 8); in begin_surrogate() 47 mbstate_set_byte(state, 3, nconv & 0xff); in begin_surrogate() 54 static size_t finish_surrogate(char16_t* pc16, mbstate_t* state) { in finish_surrogate() argument 55 char16_t trail = mbstate_get_byte(state, 1) << 8 | in finish_surrogate() 56 mbstate_get_byte(state, 0); in finish_surrogate() 58 return mbstate_reset_and_return(mbstate_get_byte(state, 3), state); in finish_surrogate() [all …]
|
D | c16rtomb.cpp | 45 mbstate_t* state = (ps == NULL) ? &__private_state : ps; in c16rtomb() local 46 if (mbsinit(state)) { in c16rtomb() 49 mbstate_set_byte(state, 3, (c32 & 0xff0000) >> 16); in c16rtomb() 50 mbstate_set_byte(state, 2, (c32 & 0x00ff00) >> 8); in c16rtomb() 53 return mbstate_reset_and_return_illegal(EINVAL, state); in c16rtomb() 55 return c32rtomb(s, static_cast<char32_t>(c16), state); in c16rtomb() 59 return mbstate_reset_and_return_illegal(EINVAL, state); in c16rtomb() 62 char32_t c32 = ((mbstate_get_byte(state, 3) << 16) | in c16rtomb() 63 (mbstate_get_byte(state, 2) << 8) | in c16rtomb() 65 return mbstate_reset_and_return(c32rtomb(s, c32, NULL), state); in c16rtomb()
|
D | __cxa_guard.cpp | 55 atomic_int state; member 64 atomic_int state; member 82 int old_value = atomic_load_explicit(&gv->state, memory_order_acquire); in __cxa_guard_acquire() 91 if (!atomic_compare_exchange_weak_explicit(&gv->state, &old_value, in __cxa_guard_acquire() 99 if (!atomic_compare_exchange_weak_explicit(&gv->state, &old_value, in __cxa_guard_acquire() 107 __futex_wait_ex(&gv->state, false, CONSTRUCTION_UNDERWAY_WITH_WAITER, false, nullptr); in __cxa_guard_acquire() 108 old_value = atomic_load_explicit(&gv->state, memory_order_acquire); in __cxa_guard_acquire() 115 int old_value = atomic_exchange_explicit(&gv->state, CONSTRUCTION_COMPLETE, memory_order_release); in __cxa_guard_release() 117 __futex_wake_ex(&gv->state, false, INT_MAX); in __cxa_guard_release() 124 …int old_value = atomic_exchange_explicit(&gv->state, CONSTRUCTION_NOT_YET_STARTED, memory_order_re… in __cxa_guard_abort() [all …]
|
D | mbrtoc32.cpp | 38 mbstate_t* state = (ps == NULL) ? &__private_state : ps; in mbrtoc32() local 43 if (mbstate_get_byte(state, 3) != 0) { in mbrtoc32() 44 return mbstate_reset_and_return_illegal(EINVAL, state); in mbrtoc32() 58 if (mbsinit(state) && (((ch = static_cast<uint8_t>(*s)) & ~0x7f) == 0)) { in mbrtoc32() 81 size_t bytes_so_far = mbstate_bytes_so_far(state); in mbrtoc32() 82 ch = bytes_so_far > 0 ? mbstate_get_byte(state, 0) : static_cast<uint8_t>(*s); in mbrtoc32() 101 return mbstate_reset_and_return_illegal(EILSEQ, state); in mbrtoc32() 108 if (!mbsinit(state) && ((*s & 0xc0) != 0x80)) { in mbrtoc32() 110 return mbstate_reset_and_return_illegal(EILSEQ, state); in mbrtoc32() 112 mbstate_set_byte(state, bytes_so_far + i, *s++); in mbrtoc32() [all …]
|
D | wchar.cpp | 62 mbstate_t* state = (ps == NULL) ? &__private_state : ps; in mbrtowc() local 65 return mbrtoc32(reinterpret_cast<char32_t*>(pwc), s, n, state); in mbrtowc() 70 mbstate_t* state = (ps == NULL) ? &__private_state : ps; in mbsnrtowcs() local 76 if (nmc > 0 && mbstate_bytes_so_far(state) > 0 && static_cast<uint8_t>((*src)[0]) < 0x80) { in mbsnrtowcs() 77 return mbstate_reset_and_return_illegal(EILSEQ, state); in mbsnrtowcs() 86 return mbstate_reset_and_return(o, state); in mbsnrtowcs() 90 r = mbrtowc(NULL, *src + i, nmc - i, state); in mbsnrtowcs() 92 return mbstate_reset_and_return_illegal(EILSEQ, state); in mbsnrtowcs() 95 return mbstate_reset_and_return_illegal(EILSEQ, state); in mbsnrtowcs() 98 return mbstate_reset_and_return(o, state); in mbsnrtowcs() [all …]
|
D | pthread_rwlock.cpp | 158 atomic_int state; member 184 static inline __always_inline bool __state_owned_by_writer(int state) { in __state_owned_by_writer() argument 185 return state < 0; in __state_owned_by_writer() 188 static inline __always_inline bool __state_owned_by_readers(int state) { in __state_owned_by_readers() argument 191 return state >= STATE_READER_COUNT_CHANGE_STEP; in __state_owned_by_readers() 194 static inline __always_inline bool __state_owned_by_readers_or_writer(int state) { in __state_owned_by_readers_or_writer() argument 195 return state < 0 || state >= STATE_READER_COUNT_CHANGE_STEP; in __state_owned_by_readers_or_writer() 198 static inline __always_inline int __state_add_writer_flag(int state) { in __state_add_writer_flag() argument 199 return state | STATE_OWNED_BY_WRITER_FLAG; in __state_add_writer_flag() 202 static inline __always_inline bool __state_is_last_reader(int state) { in __state_is_last_reader() argument [all …]
|
D | pthread_barrier.cpp | 72 _Atomic(BarrierState) state; 98 atomic_init(&barrier->state, WAIT); in pthread_barrier_init() 120 while(atomic_load_explicit(&barrier->state, memory_order_acquire) == RELEASE) { in pthread_barrier_wait() 121 __futex_wait_ex(&barrier->state, barrier->pshared, RELEASE, false, nullptr); in pthread_barrier_wait() 148 atomic_store_explicit(&barrier->state, RELEASE, memory_order_release); in pthread_barrier_wait() 149 __futex_wake_ex(&barrier->state, barrier->pshared, prev_wait_count); in pthread_barrier_wait() 154 while (atomic_load_explicit(&barrier->state, memory_order_acquire) == WAIT) { in pthread_barrier_wait() 155 __futex_wait_ex(&barrier->state, barrier->pshared, WAIT, false, nullptr); in pthread_barrier_wait() 162 atomic_store_explicit(&barrier->state, WAIT, memory_order_release); in pthread_barrier_wait() 163 __futex_wake_ex(&barrier->state, barrier->pshared, barrier->init_count); in pthread_barrier_wait() [all …]
|
D | c32rtomb.cpp | 37 mbstate_t* state = (ps == NULL) ? &__private_state : ps; in c32rtomb() local 41 return mbstate_reset_and_return(1, state); in c32rtomb() 50 return mbstate_reset_and_return(1, state); in c32rtomb() 53 if (!mbsinit(state)) { in c32rtomb() 54 return mbstate_reset_and_return_illegal(EILSEQ, state); in c32rtomb()
|
D | pthread_mutex.cpp | 219 _Atomic(uint16_t) state; 247 atomic_init(&mutex->state, MUTEX_TYPE_BITS_NORMAL); in pthread_mutex_init() 251 uint16_t state = 0; in pthread_mutex_init() local 253 state |= MUTEX_SHARED_MASK; in pthread_mutex_init() 258 state |= MUTEX_TYPE_BITS_NORMAL; in pthread_mutex_init() 261 state |= MUTEX_TYPE_BITS_RECURSIVE; in pthread_mutex_init() 264 state |= MUTEX_TYPE_BITS_ERRORCHECK; in pthread_mutex_init() 270 atomic_init(&mutex->state, state); in pthread_mutex_init() 281 if (__predict_true(atomic_compare_exchange_strong_explicit(&mutex->state, &old_state, in __pthread_normal_mutex_trylock() 325 while (atomic_exchange_explicit(&mutex->state, locked_contended, in __pthread_normal_mutex_lock() [all …]
|
D | mblen.cpp | 33 mbstate_t state = {}; in mblen() local 34 return mbrlen(s, n, &state); in mblen()
|
/bionic/libc/private/ |
D | bionic_lock.h | 44 _Atomic(LockState) state; 49 atomic_init(&state, Unlocked); in init() 55 return __predict_true(atomic_compare_exchange_strong_explicit(&state, &old_state, in trylock() 61 if (__predict_true(atomic_compare_exchange_strong_explicit(&state, &old_state, in lock() 65 while (atomic_exchange_explicit(&state, LockedWithWaiter, memory_order_acquire) != Unlocked) { in lock() 67 __futex_wait_ex(&state, process_shared, LockedWithWaiter, false, nullptr); in lock() 73 if (atomic_exchange_explicit(&state, Unlocked, memory_order_release) == LockedWithWaiter) { in unlock() 74 __futex_wake_ex(&state, process_shared, 1); in unlock()
|
/bionic/libc/upstream-netbsd/common/lib/libc/stdlib/ |
D | random.c | 248 static int *state = &randtbl[1]; variable 272 state[0] = x; in srandom_unlocked() 274 state[0] = x; in srandom_unlocked() 286 x1 = state[i - 1]; in srandom_unlocked() 292 state[i] = t; in srandom_unlocked() 294 state[i] = 1103515245 * state[i - 1] + 12345; in srandom_unlocked() 297 fptr = &state[rand_sep]; in srandom_unlocked() 298 rptr = &state[0]; in srandom_unlocked() 342 void *ostate = (void *)(&state[-1]); in initstate() 351 state[-1] = rand_type; in initstate() [all …]
|
/bionic/libc/stdio/ |
D | parsefloat.c | 47 } state = S_START; in parsefloat() local 64 switch (state) { in parsefloat() 66 state = S_GOTSIGN; in parsefloat() 74 state = S_MAYBEHEX; in parsefloat() 79 state = S_INF; in parsefloat() 83 state = S_NAN; in parsefloat() 86 state = S_DIGITS; in parsefloat() 128 state = S_DIGITS; in parsefloat() 140 state = S_FRAC; in parsefloat() 153 state = S_EXP; in parsefloat() [all …]
|
/bionic/libc/upstream-openbsd/lib/libc/net/ |
D | base64.c | 195 int tarindex, state, ch; local 199 state = 0; 213 switch (state) { 220 state = 1; 234 state = 2; 248 state = 3; 257 state = 0; 269 switch (state) { 310 if (state != 0)
|