Skip to content

Commit

Permalink
Fix long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
bobot committed Jul 14, 2021
1 parent 07da5ee commit 8cf3fb4
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions runtime/weak.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ CAMLexport mlsize_t caml_ephemeron_num_keys(value eph)
return Wosize_val (eph) - CAML_EPHE_FIRST_KEY;
}

/* The minor heap is considered alive.
Outside minor and major heap it is considered alive (out of reach of the GC). */
/* The minor heap is considered alive. Outside minor and major heap it is
considered alive (out of reach of the GC). */
Caml_inline int Test_if_its_white(value x){
CAMLassert (x != caml_ephe_none);
#ifdef NO_NAKED_POINTERS
Expand Down Expand Up @@ -228,7 +228,8 @@ CAMLexport void caml_ephemeron_set_key(value ar, mlsize_t offset, value k)
&& !Is_white_val(ar)
&& Is_White_During_Mark(Field(ar, offset))
&& !Is_White_During_Mark(k)){
/* the ephemeron could be in the set (2) only because of a white key and not have one anymore after set */
/* the ephemeron could be in the set (2) only because of a white key and not
have one anymore after set */
caml_darken(Field(ar, CAML_EPHE_DATA_OFFSET), NULL);
};
if(caml_gc_phase == Phase_clean) do_check_key_clean(ar, offset);
Expand Down Expand Up @@ -293,7 +294,8 @@ CAMLexport void caml_ephemeron_set_data (value ar, value el)
CAMLassert_valid_ephemeron(ar);

old_data = Field (ar, CAML_EPHE_DATA_OFFSET);
if (caml_gc_phase == Phase_mark && !Is_White_During_Mark(old_data)) caml_darken (el, NULL);
if (caml_gc_phase == Phase_mark && !Is_White_During_Mark(old_data))
caml_darken (el, NULL);
if (caml_gc_phase == Phase_clean){
/* During this phase since we don't know which ephemerons have been
cleaned we always need to check it. */
Expand Down Expand Up @@ -589,9 +591,10 @@ CAMLexport void caml_ephemeron_blit_key(value ars, mlsize_t offset_s,
&& !Is_White_During_Mark(Field(ard, CAML_EPHE_DATA_OFFSET))
){
/* We check here if darkening of the data of the destination is needed
because the destination could be in (2). Indeed a white key could disappear from
the destination after blitting and being in (2) requires if the ephemeron is
alive without white key to have a black or none data. */
because the destination could be in (2). Indeed a white key could
disappear from the destination after blitting and being in (2) requires
if the ephemeron is alive without white key to have a black or none
data. */

dest_has_white_value = 0;

Expand All @@ -602,7 +605,8 @@ CAMLexport void caml_ephemeron_blit_key(value ars, mlsize_t offset_s,
going to be set */
if(!dest_has_white_value) goto No_darkening;
for(i = 0; i < length; i++){
/* test if the source is going to bring a white key to replace the one set */
/* test if the source is going to bring a white key to replace the one
set */
if(Is_White_During_Mark(Field(ars, offset_s + i))) goto No_darkening;
};
/* the destination ephemeron could be in the set (2) because of a white key
Expand Down

0 comments on commit 8cf3fb4

Please sign in to comment.