pub fn permute_array(view: &V2TypedArrayView, indices: &[u32]) -> *mut u8Expand description
Materialize a permutation of view into a fresh TypedArray<T> of the
same element kind. indices[i] selects the source element at position
i of the output. Indices out of range [0, view.len) are skipped
(defensive — callers should validate up front; out-of-range indices
indicate a sort comparator bug, not a user-input edge).
Refcount discipline for heap-element kinds (String / Decimal /
TypedObject): each stored slot receives one v2_retain on the
per-element header so the output array independently owns its shares.
This matches the copy_range_to_new_array heap-arm contract — the
caller’s input view share is unaffected by this function (read-only).
Used by array_sort::handle_sort_v2 / handle_order_by_v2 /
handle_then_by_v2 to materialize the sorted permutation. Kind-generic
across all 14 monomorphized TypedArray<T> carriers per supervisor D4
v0.3 scope.