mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 11:58:41 +03:00
bring inline with C11 atomics; no volatile and cas order of expected/desired
This commit is contained in:
parent
e27422adca
commit
09ade02429
12 changed files with 170 additions and 188 deletions
|
@ -200,7 +200,7 @@ static bool os_random_buf(void* buf, size_t buf_len) {
|
|||
#ifndef GRND_NONBLOCK
|
||||
#define GRND_NONBLOCK (1)
|
||||
#endif
|
||||
static volatile _Atomic(uintptr_t) no_getrandom; // = 0
|
||||
static _Atomic(uintptr_t) no_getrandom; // = 0
|
||||
if (mi_atomic_read(&no_getrandom)==0) {
|
||||
ssize_t ret = syscall(SYS_getrandom, buf, buf_len, GRND_NONBLOCK);
|
||||
if (ret >= 0) return (buf_len == (size_t)ret);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue