Skip to content

Conversation

Daniel-Aaron-Bloom
Copy link

@Daniel-Aaron-Bloom Daniel-Aaron-Bloom commented Apr 29, 2025

Per this zulip discussion and rust-lang/rust#140341 and in contrast to the discussion on #107, read_volatile (and all other equivalent functions in the standard library) should provide strict fewer optimization barriers than black_box.

In service of testing this, I've added a script which makes sure the assembly instructions of a simple case are approximately the expected length across most common architectures.

Also read_volatile is never going to be const, and it would be nice to constify this library (which will hopefully be my next PR if this one is accepted).

@elichai
Copy link

elichai commented Aug 24, 2025

Semi Related: #135 (Also touches the cfg)

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