Skip to content

Make Peripherals::steal() zero cost #356

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

Open
Dirbaio opened this issue Oct 16, 2021 · 1 comment
Open

Make Peripherals::steal() zero cost #356

Dirbaio opened this issue Oct 16, 2021 · 1 comment

Comments

@Dirbaio
Copy link
Member

Dirbaio commented Oct 16, 2021

Peripherals::steal() has a write to a static mut:

TAKEN = true;

I expected it to be zero-cost, just constructing and returning the Peripherals which is a noop since it is ZST. This was a bit surprising.

@adamgreig
Copy link
Member

cc #186

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

No branches or pull requests

2 participants