diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2023-04-26 23:04:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 23:04:46 +0200 |
commit | 9fd4767208663033b7695c3b507239c6197bdded (patch) | |
tree | 5ee8ce78f99cf003e1c17a85ecfd3d7707ff4450 /runtime/interp.c | |
parent | 69472048a0d1782d2b773561588339136a8cf5b6 (diff) | |
parent | 2788503869eae32cbddfbc9952dd7b512a4816cb (diff) | |
download | ocaml-9fd4767208663033b7695c3b507239c6197bdded.tar.gz |
Merge pull request #12192 from gadmm/simpl_atomic
Simplification with atomic_ helpers
Diffstat (limited to 'runtime/interp.c')
-rw-r--r-- | runtime/interp.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/interp.c b/runtime/interp.c index 891096debf..92f6dd7d3e 100644 --- a/runtime/interp.c +++ b/runtime/interp.c @@ -1211,8 +1211,7 @@ value caml_interprete(code_t prog, asize_t prog_size) accu = Val_int(*pc++); /* We use relaxed atomic accesses to avoid racing with other domains updating the cache */ - ofs = atomic_load_explicit((_Atomic opcode_t *)pc, memory_order_relaxed) - & Field(meths,1); + ofs = atomic_load_relaxed((_Atomic opcode_t *)pc) & Field(meths,1); if (*(value*)(((char*)&Field(meths,3)) + ofs) == accu) { #ifdef CAML_TEST_CACHE hits++; @@ -1227,8 +1226,7 @@ value caml_interprete(code_t prog, asize_t prog_size) if (accu < Field(meths,mi)) hi = mi-2; else li = mi; } - atomic_store_explicit((_Atomic opcode_t *)pc, (li-3)*sizeof(value), - memory_order_relaxed); + atomic_store_relaxed((_Atomic opcode_t *)pc, (li-3)*sizeof(value)); accu = Field (meths, li-1); } pc++; |