diff options
author | KC Sivaramakrishnan <kc@kcsrk.info> | 2022-07-11 20:20:43 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 16:50:43 +0200 |
commit | 0e09dc477c131a404f28be373effc3508c99ff6f (patch) | |
tree | 2785ffa9cf232f4fce6633fad30adce772539906 /runtime/caml/minor_gc.h | |
parent | 4b5dc163344ff03b50cd3d3fb202774ea992cdee (diff) | |
download | ocaml-0e09dc477c131a404f28be373effc3508c99ff6f.tar.gz |
Make the Field macro a volatile access (#11255)
`Field(v,i)` is now `volatile`-qualified, to better handle races with concurrent updates in C or in OCaml.
(More complete discussion at #10992.)
`&Field(v,i)` now has type `volatile value *`. Add `volatile` qualifiers to `caml_modify`, `caml_initialize`,
and in internal parts of the runtime system.
Diffstat (limited to 'runtime/caml/minor_gc.h')
-rw-r--r-- | runtime/caml/minor_gc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/caml/minor_gc.h b/runtime/caml/minor_gc.h index 888a84b4d2..f762bc6a25 100644 --- a/runtime/caml/minor_gc.h +++ b/runtime/caml/minor_gc.h @@ -91,11 +91,11 @@ extern int caml_debug_is_major(value val); CAMLassert (ref->ptr == ref->limit); \ caml_realloc_ref_table (ref); \ } \ - *ref->ptr++ = (x); \ + *ref->ptr++ = (value*)(x); \ } while (0) Caml_inline void add_to_ephe_ref_table (struct caml_ephe_ref_table *tbl, - value ar, mlsize_t offset) + value ar, mlsize_t offset) { struct caml_ephe_ref_elt *ephe_ref; if (tbl->ptr >= tbl->limit){ |