[libc-commits] [libc] 2eafb96 - [libc][NFC] Use uint32_t to represent futex words.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Tue Jun 14 22:48:15 PDT 2022


Author: Siva Chandra Reddy
Date: 2022-06-15T05:44:00Z
New Revision: 2eafb96289da2993f65ae848a27648b3b8ebe89c

URL: https://github.com/llvm/llvm-project/commit/2eafb96289da2993f65ae848a27648b3b8ebe89c
DIFF: https://github.com/llvm/llvm-project/commit/2eafb96289da2993f65ae848a27648b3b8ebe89c.diff

LOG: [libc][NFC] Use uint32_t to represent futex words.

Futexes are 32 bits in size on all platforms, including 64-bit systems.

Added: 
    

Modified: 
    libc/src/__support/threads/linux/futex_word.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/threads/linux/futex_word.h b/libc/src/__support/threads/linux/futex_word.h
index b39723d985979..12a07329ae8d2 100644
--- a/libc/src/__support/threads/linux/futex_word.h
+++ b/libc/src/__support/threads/linux/futex_word.h
@@ -9,15 +9,12 @@
 #ifndef LLVM_LIBC_SRC_SUPPORT_THREADS_LINUX_FUTEX_WORD_H
 #define LLVM_LIBC_SRC_SUPPORT_THREADS_LINUX_FUTEX_WORD_H
 
-#include "src/__support/architectures.h"
+#include <stdint.h>
 
 namespace __llvm_libc {
 
-#if defined(LLVM_LIBC_ARCH_X86_64) || defined(LLVM_LIBC_ARCH_AARCH64)
-using FutexWordType = unsigned int;
-#else
-#error "FutexWordType not defined for the target architecture."
-#endif
+// Futexes are 32 bits in size on all platforms, including 64-bit platforms.
+using FutexWordType = uint32_t;
 
 } // namespace __llvm_libc
 


        


More information about the libc-commits mailing list