MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / _mi_random_next

Function _mi_random_next

system/lib/mimalloc/src/random.c:139–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139uintptr_t _mi_random_next(mi_random_ctx_t* ctx) {
140 mi_assert_internal(mi_random_is_initialized(ctx));
141 uintptr_t r;
142 do {
143 #if MI_INTPTR_SIZE <= 4
144 r = chacha_next32(ctx);
145 #elif MI_INTPTR_SIZE == 8
146 r = (((uintptr_t)chacha_next32(ctx) << 32) | chacha_next32(ctx));
147 #else
148 # error "define mi_random_next for this platform"
149 #endif
150 } while (r==0);
151 return r;
152}
153
154
155/* ----------------------------------------------------------------------------

Callers 1

_mi_theap_random_nextFunction · 0.85

Calls 2

mi_random_is_initializedFunction · 0.85
chacha_next32Function · 0.85

Tested by

no test coverage detected