Skip to content

Commit a3075ed

Browse files
author
Ralph Küpper
committed
docs(runtime): restore the concat_chain_sized doc comment and use the PR number
Claude-Session: https://claude.ai/code/session_012B8z92S82sCfqCrVqrFgS2
1 parent 12ddde5 commit a3075ed

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

crates/perry-runtime/src/arena/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ fn batched_flush_matches_eager_registration() {
18141814
}
18151815

18161816
// ---------------------------------------------------------------------------
1817-
// #7901: `arena_alloc_gc_no_collect` — the "allocate without a collection
1817+
// #7912: `arena_alloc_gc_no_collect` — the "allocate without a collection
18181818
// point" entry point.
18191819
//
18201820
// Its whole value is a guarantee, not a speed: a caller holding raw heap

crates/perry-runtime/src/string/concat.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,7 @@ pub extern "C" fn js_string_concat_chain(parts: *const f64, n: i32) -> *mut Stri
497497
}
498498
}
499499

500-
/// The body of [`js_string_concat_chain`], monomorphised on the scratch-array
501-
/// size. `0 < n <= MAX_PARTS` and `!parts.is_null()` are preconditions the
502-
/// dispatcher establishes.
503-
/// #7901 counter: how many chains took the unrooted fast path below. A gate
500+
/// #7912 counter: how many chains took the unrooted fast path below. A gate
504501
/// that cannot see its subject run is not a gate — the unit tests assert this
505502
/// moves, so a refactor that quietly stops taking the fast path is red rather
506503
/// than "still correct, just slow again".
@@ -608,6 +605,12 @@ fn concat_chain_all_heap_strings_no_collect<const MAX_PARTS: usize>(
608605
}
609606
}
610607

608+
/// The body of [`js_string_concat_chain`], monomorphised on the scratch-array
609+
/// size. `0 < n <= MAX_PARTS` and `!parts.is_null()` are preconditions the
610+
/// dispatcher establishes.
611+
///
612+
/// The `#7912` fast arm above answers first for an all-heap-string chain;
613+
/// everything below is the original rooted path, reached when it declines.
611614
fn concat_chain_sized<const MAX_PARTS: usize>(parts: *const f64, n: usize) -> *mut StringHeader {
612615
debug_assert!(n > 0 && n <= MAX_PARTS);
613616
if let Some(result) = concat_chain_all_heap_strings_no_collect::<MAX_PARTS>(parts, n) {

crates/perry-runtime/src/string/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ fn string_add_value_picks_the_operator_from_the_bits() {
627627
}
628628
}
629629

630-
/// #7901: the unrooted `js_string_concat_chain` fast path.
630+
/// #7912: the unrooted `js_string_concat_chain` fast path.
631631
///
632632
/// The change it covers replaces ~2N transient-handle round trips per chain
633633
/// with a proof: `string_storage_alloc_no_collect` returns `Some` only when

0 commit comments

Comments
 (0)