Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

struct SegmentId: Add newtype wrapper for seg_id that enforces in-bounds #1232

Merged
merged 4 commits into from
Jun 24, 2024

Conversation

kkysen
Copy link
Collaborator

@kkysen kkysen commented Jun 20, 2024

It also removes some checks from fn decode_b and its callees, which is also a hot spot.

@kkysen kkysen requested review from randomPoison and fbossen June 20, 2024 03:05
@kkysen kkysen force-pushed the kkysen/struct-LossLess-bit-array branch from 9973a68 to f9b1f96 Compare June 20, 2024 05:40
@kkysen kkysen force-pushed the kkysen/struct-SegmentId branch from 527d779 to c4cb161 Compare June 20, 2024 05:40
Copy link
Collaborator

@randomPoison randomPoison left a comment

Choose a reason for hiding this comment

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

The change looks good, just had a couple of minor comments/questions. Have you confirmed that this change does actually result in removing the bounds checks, though? How did you go about verifying that?

@kkysen
Copy link
Collaborator Author

kkysen commented Jun 20, 2024

Have you confirmed that this change does actually result in removing the bounds checks, though? How did you go about verifying that?

Yes; I looked at the assembly.

@kkysen kkysen force-pushed the kkysen/struct-LossLess-bit-array branch from f9b1f96 to 2720efd Compare June 21, 2024 21:04
@kkysen kkysen force-pushed the kkysen/struct-SegmentId branch from c4cb161 to e2542e2 Compare June 21, 2024 21:13
@kkysen kkysen force-pushed the kkysen/struct-SegmentId branch from e2542e2 to 969a859 Compare June 23, 2024 23:58
@kkysen kkysen changed the base branch from kkysen/struct-LossLess-bit-array to main June 23, 2024 23:59
@kkysen kkysen merged commit cf978a9 into main Jun 24, 2024
@kkysen kkysen deleted the kkysen/struct-SegmentId branch June 24, 2024 00:04
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