Skip to content

Commit 823ac37

Browse files
committed
atomically read page_bitmaps
page_bitmaps does not need to be volatile since it is going to be treated as atomic
1 parent ee39300 commit 823ac37

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/shims/atomic_sfb.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// Returns UINT_MAX if all the bits in p were already set.
3333
DISPATCH_ALWAYS_INLINE
3434
static inline unsigned int
35-
os_atomic_set_first_bit(volatile unsigned long *p, unsigned int max)
35+
os_atomic_set_first_bit(unsigned long *p, unsigned int max)
3636
{
3737
unsigned long val, bit;
3838
if (max > (sizeof(val) * 8)) {
@@ -82,7 +82,7 @@ os_atomic_set_first_bit(volatile unsigned long *p, unsigned int max)
8282

8383
DISPATCH_ALWAYS_INLINE
8484
static inline unsigned int
85-
os_atomic_set_first_bit(volatile unsigned long *p, unsigned int max_index)
85+
os_atomic_set_first_bit(unsigned long *p, unsigned int max)
8686
{
8787
unsigned int index;
8888
unsigned long b, b_masked;
@@ -94,7 +94,7 @@ os_atomic_set_first_bit(volatile unsigned long *p, unsigned int max_index)
9494
os_atomic_rmw_loop_give_up(return UINT_MAX);
9595
}
9696
index--;
97-
if (unlikely(index > max_index)) {
97+
if (unlikely(index > max)) {
9898
os_atomic_rmw_loop_give_up(return UINT_MAX);
9999
}
100100
b_masked = b | (1UL << index);

0 commit comments

Comments
 (0)