From 823ac3780c7356592e175c49e809b3368877be1d Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Mon, 25 Dec 2023 12:53:14 -0500 Subject: [PATCH] atomically read page_bitmaps page_bitmaps does not need to be volatile since it is going to be treated as atomic --- src/shims/atomic_sfb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shims/atomic_sfb.h b/src/shims/atomic_sfb.h index a87def054..b42a3a651 100644 --- a/src/shims/atomic_sfb.h +++ b/src/shims/atomic_sfb.h @@ -32,7 +32,7 @@ // Returns UINT_MAX if all the bits in p were already set. DISPATCH_ALWAYS_INLINE static inline unsigned int -os_atomic_set_first_bit(volatile unsigned long *p, unsigned int max) +os_atomic_set_first_bit(unsigned long *p, unsigned int max) { unsigned long val, bit; if (max > (sizeof(val) * 8)) { @@ -82,7 +82,7 @@ os_atomic_set_first_bit(volatile unsigned long *p, unsigned int max) DISPATCH_ALWAYS_INLINE static inline unsigned int -os_atomic_set_first_bit(volatile unsigned long *p, unsigned int max_index) +os_atomic_set_first_bit(unsigned long *p, unsigned int max) { unsigned int index; unsigned long b, b_masked; @@ -94,7 +94,7 @@ os_atomic_set_first_bit(volatile unsigned long *p, unsigned int max_index) os_atomic_rmw_loop_give_up(return UINT_MAX); } index--; - if (unlikely(index > max_index)) { + if (unlikely(index > max)) { os_atomic_rmw_loop_give_up(return UINT_MAX); } b_masked = b | (1UL << index);