summaryrefslogtreecommitdiff
path: root/libc/src/__support/threads/linux/thread.cpp
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2023-01-19 08:32:50 +0000
committerSiva Chandra Reddy <sivachandra@google.com>2023-01-20 22:27:17 +0000
commit59c809cd9bdf8d8886396e8fcd23bd9cdb0807c3 (patch)
treec22b318da6b852d6cec1c416c5b36831353b68ba /libc/src/__support/threads/linux/thread.cpp
parent7ec6c629052c30c0772e8fcae346a405af43444e (diff)
[libc][NFC] Replace static inline and inline annotations with LIBC_INLINE.
This is first of a few patches which will do similar mechanical changes. LIBC_INLINE is a simple macro which is default defined as just `inline`. The idea is that, different downstream contexts can define the macro as suitable to their use case and context. For example, one can choose to define LIBC_INLINE as `[[clang::internal_linkage]] inline`. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D142154
Diffstat (limited to 'libc/src/__support/threads/linux/thread.cpp')
-rw-r--r--libc/src/__support/threads/linux/thread.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/src/__support/threads/linux/thread.cpp b/libc/src/__support/threads/linux/thread.cpp
index e0fc69034a5f..62e24e58b9ec 100644
--- a/libc/src/__support/threads/linux/thread.cpp
+++ b/libc/src/__support/threads/linux/thread.cpp
@@ -12,6 +12,7 @@
#include "src/__support/CPP/string_view.h"
#include "src/__support/CPP/stringstream.h"
#include "src/__support/OSUtil/syscall.h" // For syscall functions.
+#include "src/__support/common.h"
#include "src/__support/error_or.h"
#include "src/__support/threads/linux/futex_word.h" // For FutexWordType
@@ -54,7 +55,7 @@ static constexpr unsigned CLONE_SYSCALL_FLAGS =
// wake the joining thread.
| CLONE_SETTLS; // Setup the thread pointer of the new thread.
-static inline ErrorOr<void *> alloc_stack(size_t size) {
+LIBC_INLINE ErrorOr<void *> alloc_stack(size_t size) {
long mmap_result =
__llvm_libc::syscall_impl(MMAP_SYSCALL_NUMBER,
0, // No special address
@@ -69,7 +70,7 @@ static inline ErrorOr<void *> alloc_stack(size_t size) {
return reinterpret_cast<void *>(mmap_result);
}
-static inline void free_stack(void *stack, size_t size) {
+LIBC_INLINE void free_stack(void *stack, size_t size) {
__llvm_libc::syscall_impl(SYS_munmap, stack, size);
}