Skip to content

Commit

Permalink
Refactor loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil committed Mar 7, 2024
1 parent 94d1e3b commit 4689158
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/multicont_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ CAMLprim value multicont_clone_continuation(value k) {
// Retrieve the stack pointed to by the continuation [k]
source = current = Ptr_val(caml_continuation_use(k));

// NOTE: We know now that [current] is non-null, as otherwise
// [caml_continuation_use] would have raised an exception.
// Copy each stack segment in the chain
while (current != NULL) {
do {
space_used = Stack_high(current) - (value*)current->sp;

int64_t fiber_id;
Expand Down Expand Up @@ -129,7 +131,7 @@ CAMLprim value multicont_clone_continuation(value k) {
*link = clone;
link = &Stack_parent(clone);
current = Stack_parent(current);
}
} while (current != NULL);

#if MULTICONT52
caml_modify(&Field(kclone, 1), Val_ptr(last_segment));
Expand Down

0 comments on commit 4689158

Please sign in to comment.