From 59c809cd9bdf8d8886396e8fcd23bd9cdb0807c3 Mon Sep 17 00:00:00 2001 From: Siva Chandra Reddy Date: Thu, 19 Jan 2023 08:32:50 +0000 Subject: [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 --- libc/src/__support/threads/linux/thread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libc/src/__support/threads/linux/thread.cpp') 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 alloc_stack(size_t size) { +LIBC_INLINE ErrorOr 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 alloc_stack(size_t size) { return reinterpret_cast(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); } -- cgit v1.2.3