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

Add restore-state-usize #40

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

chrysn
Copy link
Contributor

@chrysn chrysn commented Oct 21, 2023

The existing restore-state-* options all go for concrete sizes; this adds an option that goes for usize (however large that may be on a platform).

This is an odd choice at first glance -- a typical implementation will be bound to an architecture and thus know the width of their usize anyway. However, when porting to a portable operating system (such as RIOT OS), the state that needs to be persisted may be defined as usize (or, in the case of RIOT OS, C's int type). Sure it might be possible to fan out somewhere in the build system and enable the right features on the right platforms, but given how cargo's graph resolution works, this needs cumbersome out-of-cargo setups, so providing a usize restore state appears to be the cleanest way forward.

@chrysn chrysn requested a review from a team as a code owner October 21, 2023 21:10
Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Dirbaio Dirbaio added this pull request to the merge queue Oct 22, 2023
Merged via the queue into rust-embedded:main with commit 6325940 Oct 22, 2023
7 checks passed
@chrysn chrysn deleted the add-usize branch January 26, 2024 13:21
This was referenced Aug 21, 2024
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