diff options
-rw-r--r-- | kern/atomic_i.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kern/atomic_i.h b/kern/atomic_i.h index 9986622..0087d03 100644 --- a/kern/atomic_i.h +++ b/kern/atomic_i.h @@ -210,7 +210,8 @@ union atomic_val_64 { #endif /* __LP64__ */ -#define atomic_ptr_aligned(ptr) P2ALIGNED((uintptr_t)(ptr), sizeof(ptr)) +#define ATOMIC_ALIGN(ptr) MIN(sizeof(*(ptr)), sizeof(ptr)) +#define atomic_ptr_aligned(ptr) P2ALIGNED((uintptr_t)(ptr), ATOMIC_ALIGN(ptr)) /* atomic_load */ |