Skip to content

feat: remove all unsafe code from the project - #55

Merged
LPGhatguy merged 1 commit into
LPGhatguy:mainfrom
sanbox-irl:push-kksyqwsruuup
Aug 18, 2026
Merged

feat: remove all unsafe code from the project#55
LPGhatguy merged 1 commit into
LPGhatguy:mainfrom
sanbox-irl:push-kksyqwsruuup

Conversation

@sanbox-irl

@sanbox-irl sanbox-irl commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

I was nerdsniped by #47 and went ahead and removed all the unsafe code in the repo without adding runtime unwraps. Well...without adding any new runtime unwraps. In reality, both of these were handling the NonZeroU32 was 0 case -- I just rerouted them such that they didn't do a new unwrap.

https://godbolt.org/z/n8Teha5Gc

We have two cases of unsafety: Generation::next and FreePointer::from_slot. Generation::next's new safe-only implementation produces the exact same bytecode.
Interestingly, FreePointer::from_slot is now faster while being safe -- we lost one single instruction in the new method. Surely that'll be massive percentage increases in speed!

In all reality, these are minor tweaks with syntax.

@LPGhatguy LPGhatguy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, heck yeah!

@LPGhatguy
LPGhatguy merged commit 8fc05cb into LPGhatguy:main Aug 18, 2026
2 checks passed
@sanbox-irl
sanbox-irl deleted the push-kksyqwsruuup branch August 18, 2026 12:44
Sign up for free to 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