Searched refs:state (Results 1 - 25 of 57) sorted by relevance

123

/bionic/libc/bionic/
H A Dmbrtoc16.cpp36 static inline bool mbspartialc16(const mbstate_t* state) { argument
37 return mbstate_get_byte(state, 3) != 0;
41 size_t nconv, mbstate_t* state) {
45 mbstate_set_byte(state, 0, trail & 0x00ff);
46 mbstate_set_byte(state, 1, (trail & 0xff00) >> 8);
47 mbstate_set_byte(state, 3, nconv & 0xff);
54 static size_t finish_surrogate(char16_t* pc16, mbstate_t* state) { argument
55 char16_t trail = mbstate_get_byte(state, 1) << 8 |
56 mbstate_get_byte(state, 0);
58 return reset_and_return(mbstate_get_byte(state,
40 begin_surrogate(char32_t c32, char16_t* pc16, size_t nconv, mbstate_t* state) argument
63 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
[all...]
H A Dmbrtoc32.cpp38 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
40 // We should never get to a state which has all 4 bytes of the sequence set.
41 // Full state verification is done when decoding the sequence (after we have
43 if (mbstate_get_byte(state, 3) != 0) {
44 return reset_and_return_illegal(EINVAL, state);
58 if (mbsinit(state) && (((ch = static_cast<uint8_t>(*s)) & ~0x7f) == 0)) {
80 // The first byte in the state (if any) tells the length.
81 size_t bytes_so_far = mbstate_bytes_so_far(state);
82 ch = bytes_so_far > 0 ? mbstate_get_byte(state, 0) : static_cast<uint8_t>(*s);
101 return reset_and_return_illegal(EILSEQ, state);
[all...]
H A D__cxa_guard.cpp55 atomic_int state; member in union:_guard_t
64 atomic_int state; member in union:_guard_t
70 // Set construction state values according to reference documentation.
82 int old_value = atomic_load_explicit(&gv->state, memory_order_relaxed);
86 // A load_acquire operation is need before exiting with COMPLETE state, as we have to ensure
92 if (!atomic_compare_exchange_weak_explicit(&gv->state, &old_value,
104 if (!atomic_compare_exchange_weak_explicit(&gv->state, &old_value,
112 __futex_wait_ex(&gv->state, false, CONSTRUCTION_UNDERWAY_WITH_WAITER, false, nullptr);
113 old_value = atomic_load_explicit(&gv->state, memory_order_relaxed);
120 int old_value = atomic_exchange_explicit(&gv->state, CONSTRUCTION_COMPLET
[all...]
H A Dc16rtomb.cpp45 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
46 if (mbsinit(state)) {
49 mbstate_set_byte(state, 3, (c32 & 0xff0000) >> 16);
50 mbstate_set_byte(state, 2, (c32 & 0x00ff00) >> 8);
53 return reset_and_return_illegal(EINVAL, state);
55 return c32rtomb(s, static_cast<char32_t>(c16), state);
59 return reset_and_return_illegal(EINVAL, state);
62 char32_t c32 = ((mbstate_get_byte(state, 3) << 16) |
63 (mbstate_get_byte(state, 2) << 8) |
65 return reset_and_return(c32rtomb(s, c32, NULL), state);
[all...]
H A Dstubs.cpp50 // okay for all the <grp.h> functions to share state, and all the <passwd.h>
51 // functions to share state, but <grp.h> functions can't clobber <passwd.h>
52 // functions' state and vice versa.
70 static void init_group_state(group_state_t* state) { argument
71 memset(state, 0, sizeof(group_state_t));
72 state->group_.gr_mem = state->group_members_;
143 static passwd* android_iinfo_to_passwd(passwd_state_t* state, argument
145 snprintf(state->name_buffer_, sizeof(state
158 android_iinfo_to_group(group_state_t* state, const android_id_info* iinfo) argument
169 android_id_to_passwd(passwd_state_t* state, unsigned id) argument
178 android_name_to_passwd(passwd_state_t* state, const char* name) argument
187 android_id_to_group(group_state_t* state, unsigned id) argument
196 android_name_to_group(group_state_t* state, const char* name) argument
330 oem_id_to_passwd(uid_t uid, passwd_state_t* state) argument
349 oem_id_to_group(gid_t gid, group_state_t* state) argument
370 app_id_to_passwd(uid_t uid, passwd_state_t* state) argument
398 app_id_to_group(gid_t gid, group_state_t* state) argument
414 passwd_state_t* state = g_passwd_tls_buffer.get(); local
432 passwd_state_t* state = g_passwd_tls_buffer.get(); local
464 getgrgid_internal(gid_t gid, group_state_t* state) argument
478 group_state_t* state = __group_state(); local
485 getgrnam_internal(const char* name, group_state_t* state) argument
499 group_state_t* state = __group_state(); local
515 group_state_t* state = reinterpret_cast<group_state_t*>(p); local
[all...]
H A Dc32rtomb.cpp37 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
41 return reset_and_return(1, state);
46 // shift state. Since shift states are not supported, only the null byte is
50 reset_and_return(1, state);
53 if (!mbsinit(state)) {
54 return reset_and_return_illegal(EILSEQ, state);
H A Dpthread_barrier.cpp70 // Barrier state. It is WAIT if waiting for more threads to enter the barrier in this cycle,
72 _Atomic(BarrierState) state; member in struct:pthread_barrier_internal_t
98 atomic_init(&barrier->state, WAIT);
120 while(atomic_load_explicit(&barrier->state, memory_order_acquire) == RELEASE) {
121 __futex_wait_ex(&barrier->state, barrier->pshared, RELEASE, false, nullptr);
148 atomic_store_explicit(&barrier->state, RELEASE, memory_order_release);
149 __futex_wake_ex(&barrier->state, barrier->pshared, prev_wait_count);
154 while (atomic_load_explicit(&barrier->state, memory_order_acquire) == WAIT) {
155 __futex_wait_ex(&barrier->state, barrier->pshared, WAIT, false, nullptr);
162 atomic_store_explicit(&barrier->state, WAI
[all...]
H A Dwchar.cpp42 // The state is the UTF-8 sequence. We only support <= 4-bytes sequences so LP32
45 // intermediary state).
47 // The C standard leaves the conversion state undefined after a bad conversion.
49 // state we always reset the conversion state when encountering illegal
62 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
65 return mbrtoc32(reinterpret_cast<char32_t*>(pwc), s, n, state);
70 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
79 if ((nmc > 0) && (mbstate_bytes_so_far(state) > 0)
81 return reset_and_return_illegal(EILSEQ, state);
152 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
160 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
[all...]
H A Dpthread_rwlock.cpp137 // A rwlock state is implemented as a 32-bit integer which has following rules:
158 atomic_int state; member in struct:pthread_rwlock_internal_t
166 // in state, increase pending_reader_count, and wait on pending_reader_wakeup_serial. After woken
168 // remove STATE_HAVE_PENDING_READERS_FLAG in state. A pending writer thread works in a similar way,
184 static inline __always_inline bool __state_owned_by_writer(int state) { argument
185 return state < 0;
188 static inline __always_inline bool __state_owned_by_readers(int state) { argument
189 // If state >= 0, the owned_by_writer_flag is not set.
190 // And if state >= STATE_READER_COUNT_CHANGE_STEP, the reader_count field is not empty.
191 return state >
194 __state_owned_by_readers_or_writer(int state) argument
198 __state_add_writer_flag(int state) argument
202 __state_is_last_reader(int state) argument
206 __state_have_pending_writers(int state) argument
210 __state_have_pending_readers_or_writers(int state) argument
[all...]
H A Dpthread_mutex.cpp116 /* a mutex contains a state value and a owner_tid.
123 * 1-0 state lock state (0, 1 or 2)
148 /* Mutex state:
219 _Atomic(uint16_t) state; member in struct:pthread_mutex_internal_t
247 atomic_init(&mutex->state, MUTEX_TYPE_BITS_NORMAL);
251 uint16_t state = 0; local
253 state |= MUTEX_SHARED_MASK;
258 state |= MUTEX_TYPE_BITS_NORMAL;
261 state |
[all...]
H A Dpthread_cond.cpp108 atomic_uint state; member in struct:pthread_cond_internal_t
111 return COND_IS_SHARED(atomic_load_explicit(&state, memory_order_relaxed));
115 return COND_GET_CLOCK(atomic_load_explicit(&state, memory_order_relaxed)) == CLOCK_REALTIME;
142 atomic_init(&cond->state, init_state);
149 atomic_store_explicit(&cond->state, 0xdeadc04d, memory_order_relaxed);
167 atomic_fetch_add_explicit(&cond->state, COND_COUNTER_STEP, memory_order_relaxed);
169 __futex_wake_ex(&cond->state, cond->process_shared(), thread_count);
180 unsigned int old_state = atomic_load_explicit(&cond->state, memory_order_relaxed);
182 int status = __futex_wait_ex(&cond->state, cond->process_shared(), old_state,
/bionic/tests/
H A Dstring_test.cpp222 // Calculate input lengths and fill state.len with them.
256 StringTestState<char> state(SMALL);
257 for (size_t i = 1; i < state.n; i++) {
258 for (state.BeginIterations(); state.HasNextIteration(); state.NextIteration()) {
259 memset(state.ptr2, '\2', state.MAX_LEN);
260 state.ptr2[state
[all...]
/bionic/benchmarks/
H A Dunistd_benchmark.cpp22 static void BM_unistd_getpid(benchmark::State& state) { argument
23 while (state.KeepRunning()) {
29 static void BM_unistd_getpid_syscall(benchmark::State& state) { argument
30 while (state.KeepRunning()) {
41 static void BM_unistd_gettid(benchmark::State& state) { argument
42 while (state.KeepRunning()) {
50 void BM_unistd_gettid_syscall(benchmark::State& state) { argument
51 while (state.KeepRunning()) {
H A Dmath_benchmark.cpp27 static void SetLabel(benchmark::State& state) { argument
28 state.SetLabel(names[state.range_x()]);
35 static void BM_math_sqrt(benchmark::State& state) { argument
38 while (state.KeepRunning()) {
44 static void BM_math_log10(benchmark::State& state) { argument
47 while (state.KeepRunning()) {
53 static void BM_math_logb(benchmark::State& state) { argument
56 while (state.KeepRunning()) {
62 static void BM_math_isfinite_macro(benchmark::State& state) { argument
77 BM_math_isfinite(benchmark::State& state) argument
87 BM_math_isinf_macro(benchmark::State& state) argument
97 BM_math_isinf(benchmark::State& state) argument
107 BM_math_isnan_macro(benchmark::State& state) argument
117 BM_math_isnan(benchmark::State& state) argument
127 BM_math_isnormal_macro(benchmark::State& state) argument
138 BM_math_isnormal(benchmark::State& state) argument
149 BM_math_sin_fast(benchmark::State& state) argument
157 BM_math_sin_feupdateenv(benchmark::State& state) argument
169 BM_math_sin_fesetenv(benchmark::State& state) argument
181 BM_math_fpclassify(benchmark::State& state) argument
191 BM_math_signbit_macro(benchmark::State& state) argument
201 BM_math_signbit(benchmark::State& state) argument
211 BM_math_fabs_macro(benchmark::State& state) argument
221 BM_math_fabs(benchmark::State& state) argument
[all...]
H A Dpthread_benchmark.cpp24 static void BM_pthread_self(benchmark::State& state) { argument
25 while (state.KeepRunning()) {
31 static void BM_pthread_getspecific(benchmark::State& state) { argument
35 while (state.KeepRunning()) {
43 static void BM_pthread_setspecific(benchmark::State& state) { argument
47 while (state.KeepRunning()) {
58 static void BM_pthread_once(benchmark::State& state) { argument
62 while (state.KeepRunning()) {
68 static void BM_pthread_mutex_lock(benchmark::State& state) { argument
71 while (state
78 BM_pthread_mutex_lock_ERRORCHECK(benchmark::State& state) argument
88 BM_pthread_mutex_lock_RECURSIVE(benchmark::State& state) argument
98 BM_pthread_rwlock_read(benchmark::State& state) argument
111 BM_pthread_rwlock_write(benchmark::State& state) argument
128 BM_pthread_create(benchmark::State& state) argument
140 benchmark::State& state = *reinterpret_cast<benchmark::State*>(arg); local
145 BM_pthread_create_and_run(benchmark::State& state) argument
156 benchmark::State& state = *reinterpret_cast<benchmark::State*>(arg); local
161 BM_pthread_exit_and_join(benchmark::State& state) argument
171 BM_pthread_key_create(benchmark::State& state) argument
183 BM_pthread_key_delete(benchmark::State& state) argument
[all...]
H A Dtime_benchmark.cpp24 static void BM_time_clock_gettime(benchmark::State& state) { argument
26 while (state.KeepRunning()) {
32 static void BM_time_clock_gettime_syscall(benchmark::State& state) { argument
34 while (state.KeepRunning()) {
40 static void BM_time_gettimeofday(benchmark::State& state) { argument
42 while (state.KeepRunning()) {
48 void BM_time_gettimeofday_syscall(benchmark::State& state) { argument
50 while (state.KeepRunning()) {
56 void BM_time_time(benchmark::State& state) { argument
57 while (state
[all...]
H A Dstdio_benchmark.cpp31 void ReadWriteTest(benchmark::State& state, Fn f, bool buffered) { argument
32 size_t chunk_size = state.range_x();
42 while (state.KeepRunning()) {
46 state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(chunk_size));
51 void BM_stdio_fread(benchmark::State& state) { argument
52 ReadWriteTest(state, fread, true);
56 void BM_stdio_fwrite(benchmark::State& state) { argument
57 ReadWriteTest(state, fwrite, true);
61 void BM_stdio_fread_unbuffered(benchmark::State& state) { argument
66 BM_stdio_fwrite_unbuffered(benchmark::State& state) argument
71 FopenFgetsFclose(benchmark::State& state, bool no_locking) argument
81 BM_stdio_fopen_fgets_fclose_locking(benchmark::State& state) argument
86 BM_stdio_fopen_fgets_fclose_no_locking(benchmark::State& state) argument
[all...]
H A Dstring_benchmark.cpp30 static void BM_string_memcmp(benchmark::State& state) { argument
31 const size_t nbytes = state.range_x();
37 while (state.KeepRunning()) {
41 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
47 static void BM_string_memcpy(benchmark::State& state) { argument
48 const size_t nbytes = state.range_x();
52 while (state.KeepRunning()) {
56 state.SetBytesProcessed(uint64_t(state
62 BM_string_memmove(benchmark::State& state) argument
76 BM_string_memset(benchmark::State& state) argument
89 BM_string_strlen(benchmark::State& state) argument
[all...]
H A Dsemaphore_benchmark.cpp25 static void BM_semaphore_sem_getvalue(benchmark::State& state) { argument
29 while (state.KeepRunning()) {
36 static void BM_semaphore_sem_wait_sem_post(benchmark::State& state) { argument
40 while (state.KeepRunning()) {
117 BENCHMARK_F(SemaphoreFixture, semaphore_sem_post)(benchmark::State& state) {
118 while (state.KeepRunning()) {
119 state.PauseTiming();
141 state.ResumeTiming();
H A Dproperty_benchmark.cpp51 printf("making temp file for test state failed (is %s/local/tmp writable?): %s\n",
144 static void BM_property_get(benchmark::State& state) { argument
145 const size_t nprops = state.range_x();
150 while (state.KeepRunning()) {
157 static void BM_property_find(benchmark::State& state) { argument
158 const size_t nprops = state.range_x();
163 while (state.KeepRunning()) {
169 static void BM_property_read(benchmark::State& state) { argument
170 const size_t nprops = state.range_x();
183 while (state
192 BM_property_serial(benchmark::State& state) argument
[all...]
/bionic/libc/private/
H A Dbionic_lock.h44 _Atomic(LockState) state; member in class:Lock
49 atomic_init(&state, Unlocked);
55 return __predict_true(atomic_compare_exchange_strong_explicit(&state, &old_state,
61 if (__predict_true(atomic_compare_exchange_strong_explicit(&state, &old_state,
65 while (atomic_exchange_explicit(&state, LockedWithWaiter, memory_order_acquire) != Unlocked) {
67 __futex_wait_ex(&state, process_shared, LockedWithWaiter, false, nullptr);
73 if (atomic_exchange_explicit(&state, Unlocked, memory_order_release) == LockedWithWaiter) {
74 __futex_wake_ex(&state, process_shared, 1);
/bionic/libc/upstream-netbsd/common/lib/libc/stdlib/
H A Drandom.c76 * rand()/srand() like interface, this package also has a special state info
80 * that much state information. Good sizes for the amount of state
81 * information are 32, 64, 128, and 256 bytes. The state can be switched by
83 * with initstate(). By default, the package runs with 128 bytes of state
85 * congruential generator. If the amount of state information is less than
88 * Internally, the state information is treated as an array of ints; the
90 * integer); the remainder of the array is the state information for the
91 * R.N.G. Thus, 32 bytes of state information will give 7 ints worth of
92 * state informatio
248 static int *state = &randtbl[1]; variable
[all...]
/bionic/libc/kernel/uapi/linux/netfilter/
H A Dnf_conntrack_sctp.h40 enum sctp_conntrack state; member in struct:ip_ct_sctp
/bionic/libc/upstream-netbsd/android/include/sys/
H A Dsha1.h19 uint32_t state[5]; member in struct:__anon1014
/bionic/libc/dns/net/
H A Dbase64.c221 int state, ch; local
227 state = 0;
241 switch (state) {
248 state = 1;
260 state = 2;
272 state = 3;
281 state = 0;
295 switch (state) {
335 if (state != 0)

Completed in 2452 milliseconds

123