Repository navigation
D115 Amendment 1 step 2: the List header's word 3 is start, an owned List's head comes off in O(1); #2289 guards after a take - #2352
Merged
Merged
Conversation
added 4 commits
October 11, 2026 21:42
…ed List's head comes off in O(1) (LIST_TAKE_FRONT advances ptr/start), grow and free read the allocation through start, shrink_to_fit releases the prefix; the unsuffixed helpers go; both backends and the C header follow
…es elements out of an owned List; a failed guard puts a head back through the prefix (LIST_RESTORE_FRONT) and a tail back by push, after the remainder is back in the subject
…e base; two ceremony items the gate caught
…ired; behav_2289_guard_after_owned_list_take covers the accepted form
Contributor
Author
|
Battery green on bc5eac7 (seed-driven, |
ehartford
marked this pull request as ready for review
October 12, 2026 05:50
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits on top of the seed bump (
7a3737b66), building fromnightly-20261011-local-2, which has the sized helpers step 1 introduced.cafb4ba72): word 3 of the List header isstart, the elements beforeptrin the allocation.[h, ..t]over an owned List takes the head by advancing the header (LIST_TAKE_FRONT→with_vec_take_front_es), so the canonical recursion is O(n) and allocation-free per step; grow and free read the allocation throughstart;shrink_to_fit()releases the prefix and the spare capacity; the stack literal (D119) writes 0 at word 3; the unsuffixed helpers, the C header's old prototypes and the last compiler-internal raw uses go. Fixture:behav_d115_amendment1_offset_rest.w.8bb082554): a match guard may follow a pattern that takes elements out of an owned List: a failed guard puts a head back through the prefix (LIST_RESTORE_FRONT) and a tail back by push, after the move log has put the remainder back in the subject. Fixture:behav_2289_guard_after_owned_list_take.w, leak-free under the debug allocator.Found and filed: #2351 (
match moveon a List parameter whose pattern takes nothing out, or leaves the remainder under a bare.., leaks the subject) — pre-existing, reproduced on the installed compiler; the allocation-count fixture for Amendment 1 waits on it.Gate and battery: pending.