We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f50ccc commit 0ff222cCopy full SHA for 0ff222c
ocaml/runtime/memory.c
@@ -671,7 +671,17 @@ CAMLexport CAMLweakdef void caml_modify (value *fp, value val)
671
if (Is_young(old)) return;
672
/* Here, [old] can be a pointer within the major heap.
673
Check for condition 2. */
674
- if (caml_gc_phase == Phase_mark) caml_darken(old, NULL);
+ if (caml_gc_phase == Phase_mark) {
675
+ header_t hd = Hd_val(old);
676
+ if (Tag_hd (hd) == Infix_tag) {
677
+ /* Infix_tag is always Caml_white */
678
+ CAMLassert(Is_white_hd(hd));
679
+ }
680
+ /* Inline the white-header check, to save a pagetable lookup */
681
+ if (Is_white_hd(hd)) {
682
+ caml_darken(old, NULL);
683
684
685
}
686
/* Check for condition 1. */
687
if (Is_block(val) && Is_young(val)) {
0 commit comments