Searched defs:state (Results 1 - 25 of 74) sorted by relevance

123

/bionic/libc/bionic/
H A Dmblen.cpp33 mbstate_t state = {}; local
34 return mbrlen(s, n, &state);
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 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 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_acquire);
91 if (!atomic_compare_exchange_weak_explicit(&gv->state, &old_value,
99 if (!atomic_compare_exchange_weak_explicit(&gv->state, &old_value,
107 __futex_wait_ex(&gv->state, false, CONSTRUCTION_UNDERWAY_WITH_WAITER, false, nullptr);
108 old_value = atomic_load_explicit(&gv->state, memory_order_acquire);
115 int old_value = atomic_exchange_explicit(&gv->state, CONSTRUCTION_COMPLETE, memory_order_release);
117 __futex_wake_ex(&gv->state, fals
[all...]
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 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 Dpthread_attr.cpp56 int pthread_attr_setdetachstate(pthread_attr_t* attr, int state) { argument
57 if (state == PTHREAD_CREATE_DETACHED) {
59 } else if (state == PTHREAD_CREATE_JOINABLE) {
67 int pthread_attr_getdetachstate(const pthread_attr_t* attr, int* state) { argument
68 *state = (attr->flags & PTHREAD_ATTR_FLAG_DETACHED) ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE;
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
76 if (nmc > 0 && mbstate_bytes_so_far(state) > 0 && static_cast<uint8_t>((*src)[0]) < 0x80) {
77 return reset_and_return_illegal(EILSEQ, state);
141 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
149 mbstate_t* state = (ps == NULL) ? &__private_state : ps; local
[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 Datomic_benchmark.cpp46 void BM_empty(benchmark::State& state) { argument
47 while (state.KeepRunning()) {
53 static void BM_load_relaxed(benchmark::State& state) { argument
55 while (state.KeepRunning()) {
63 static void BM_load_acquire(benchmark::State& state) { argument
65 while (state.KeepRunning()) {
73 static void BM_store_release(benchmark::State& state) { argument
75 while (state.KeepRunning()) {
82 static void BM_store_seq_cst(benchmark::State& state) { argument
84 while (state
91 BM_fetch_add_relaxed(benchmark::State& state) argument
101 BM_fetch_add_seq_cst(benchmark::State& state) argument
114 BM_acquire_fence(benchmark::State& state) argument
125 BM_seq_cst_fence(benchmark::State& state) argument
138 BM_fetch_add_cs(benchmark::State& state) argument
[all...]
H A Dstring_benchmark.cpp29 static void BM_string_memcmp(benchmark::State& state) { argument
30 const size_t nbytes = state.range(0);
36 while (state.KeepRunning()) {
40 state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
46 static void BM_string_memcpy(benchmark::State& state) { argument
47 const size_t nbytes = state.range(0);
51 while (state.KeepRunning()) {
55 state.SetBytesProcessed(uint64_t(state
61 BM_string_memmove(benchmark::State& state) argument
75 BM_string_memset(benchmark::State& state) argument
88 BM_string_strlen(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
63 BM_time_localtime(benchmark::State& state) argument
71 BM_time_localtime_r(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()) {
122 BENCHMARK_F(SemaphoreFixture, semaphore_sem_post)(benchmark::State& state) {
123 while (state.KeepRunning()) {
124 state.PauseTiming();
146 state.ResumeTiming();
H A Dstdio_benchmark.cpp30 void ReadWriteTest(benchmark::State& state, Fn f, bool buffered) { argument
31 size_t chunk_size = state.range(0);
41 while (state.KeepRunning()) {
45 state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(chunk_size));
50 void BM_stdio_fread(benchmark::State& state) { argument
51 ReadWriteTest(state, fread, true);
55 void BM_stdio_fwrite(benchmark::State& state) { argument
56 ReadWriteTest(state, fwrite, true);
60 void BM_stdio_fread_unbuffered(benchmark::State& state) { argument
65 BM_stdio_fwrite_unbuffered(benchmark::State& state) argument
70 FopenFgetsFclose(benchmark::State& state, bool no_locking) argument
80 BM_stdio_fopen_fgets_fclose_locking(benchmark::State& state) argument
85 BM_stdio_fopen_fgets_fclose_no_locking(benchmark::State& state) argument
[all...]
H A Dmath_benchmark.cpp27 static void SetLabel(benchmark::State& state) { argument
28 state.SetLabel(names[state.range(0)]);
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 Dproperty_benchmark.cpp49 printf("making temp file for test state failed (is %s/local/tmp writable?): %s\n",
137 static void BM_property_get(benchmark::State& state) { argument
138 const size_t nprops = state.range(0);
143 while (state.KeepRunning()) {
150 static void BM_property_find(benchmark::State& state) { argument
151 const size_t nprops = state.range(0);
156 while (state.KeepRunning()) {
162 static void BM_property_read(benchmark::State& state) { argument
163 const size_t nprops = state.range(0);
176 while (state
185 BM_property_serial(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...]
/bionic/libc/upstream-netbsd/android/include/sys/
H A Dsha1.h19 uint32_t state[5]; member in struct:__anon1128
/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-openbsd/lib/libc/net/
H A Dbase64.c195 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)
/bionic/libc/stdio/
H A Dparsefloat.c47 } state = S_START; local
64 switch (state) {
66 state = S_GOTSIGN;
74 state = S_MAYBEHEX;
79 state = S_INF;
83 state = S_NAN;
86 state = S_DIGITS;
128 state = S_DIGITS;
140 state = S_FRAC;
153 state
195 } state = S_START; local
[all...]
/bionic/libc/upstream-openbsd/lib/libc/stdio/
H A Dfmemopen.c27 struct state { struct
38 struct state *st = v;
51 struct state *st = v;
73 struct state *st = v;
108 struct state *st = v;
119 struct state *st;
H A Dopen_memstream.c29 struct state { struct
41 struct state *st = v;
78 struct state *st = v;
106 struct state *st = v;
116 struct state *st;
H A Dopen_wmemstream.c30 struct state { struct
37 mbstate_t mbs; /* conversion state of the stream */
43 struct state *st = v;
82 struct state *st = v;
102 * XXX Clearing mbs here invalidates shift state for state-
116 struct state *st = v;
126 struct state *st;

Completed in 282 milliseconds

123