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

Unbox slot types #13382

Merged
merged 1 commit into from
Jun 9, 2023
Merged

Unbox slot types #13382

merged 1 commit into from
Jun 9, 2023

Conversation

psteckler
Copy link
Member

Unbox the types Global_slot_since_genesis.t, Global_slot_since_hard_fork.t, and Global_slot_span.t. Those types have a single constructor, so the variant tag conveys no information, hence the run-time representation of the type can be the same as the constructor argument. This change saves some space, because the type tag is elided, and some time, boxing and unboxing values is not needed.

For generality, ppx_version is changed so that if a type is unboxed, a generated With_top_tag or With_version_tags module will also have an unboxed type. That part of this PR was tested when the slot types had such modules, though they do not now.

@psteckler psteckler requested review from a team as code owners June 9, 2023 00:16
@psteckler
Copy link
Member Author

!ci-build-me

@mrmr1993
Copy link
Member

mrmr1993 commented Jun 9, 2023

!approved-for-mainnet

@psteckler psteckler merged commit efec262 into berkeley Jun 9, 2023
@psteckler psteckler deleted the feature/unbox-slot-types branch June 9, 2023 03:38
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