Skip to content

atomically read page_bitmaps#810

Open
LumioseSil wants to merge 1 commit into
swiftlang:mainfrom
LumioseSil:atomically
Open

atomically read page_bitmaps#810
LumioseSil wants to merge 1 commit into
swiftlang:mainfrom
LumioseSil:atomically

Conversation

@LumioseSil
Copy link
Copy Markdown
Contributor

@LumioseSil LumioseSil commented Dec 25, 2023

page_bitmaps does not need to be volatile since it is going to be treated as atomic. In fact, as long as each variable is treated as atomic, we do not need volatile at all, as that means it is modified by outside means, aka hardware, etc.

The atomic macros already ensure optimizations that could cause incorrect values to be used do not happen.

@LumioseSil LumioseSil force-pushed the atomically branch 2 times, most recently from 823ac37 to 941d613 Compare December 25, 2023 18:03
page_bitmaps does not need to be volatile since it is going to be treated as atomic. In fact, as long as each variable is treated as atomic, we do not need volatile at all, as that means it is modified by outside means, aka hardware, etc.

The atomic macros already ensure optimizations that could cause incorrect values to be used do not happen.

Finally, the first loop is redundant as they are iterated over again in the loop below.
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.

1 participant