Skip to content

Add getSentinel helper to Pointer and Array builtin.Types - #21993

Closed
xdBronch wants to merge 1 commit into
ziglang:masterfrom
xdBronch:push-xyrnpwlwxolz
Closed

Add getSentinel helper to Pointer and Array builtin.Types#21993
xdBronch wants to merge 1 commit into
ziglang:masterfrom
xdBronch:push-xyrnpwlwxolz

Conversation

@xdBronch

Copy link
Copy Markdown
Contributor

No description provided.

@mlugg

Copy link
Copy Markdown
Member

I think it'd make more sense for the field to be sentinel_ptr and the method sentinel().

@xdBronch

Copy link
Copy Markdown
ContributorAuthor

the breakings will continue until morale improves 🙃

@xdBronch

xdBronch commented Nov 15, 2024

Copy link
Copy Markdown
ContributorAuthor

hmm im having second thoughts on this asserting that its not null. a decent number of uses of sentinel_ptr are first checking if its null, as does std.meta.sentinel (which i didnt notice existed before :p but i think itd still be favorable to have something builtin like this). thoughts? yeah nevermind i think this is vastly more useful if it returns null

@xdBronch

Copy link
Copy Markdown
ContributorAuthor

so if im not wrong this requires a zig1 update since it changes builtin, correct? assuming this change is deemed worth it, is the correct order of operations something like this?
commit 1. change the field in builtin.zig and sema + any uses of it
commit 2. update zig1.wasm, later to be replaced by a team member
commit 3. add the function and update any places where its useful

@xdBronch

Copy link
Copy Markdown
ContributorAuthor

superseded by #22496

@xdBronch
xdBronch deleted the push-xyrnpwlwxolz branch January 16, 2025 04:16
@mlugg

Copy link
Copy Markdown
Member

Sorry, I forgot about this PR! Your changes will make it in in spirit

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xdBronch@mlugg