File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 2525namespace LIBC_NAMESPACE_DECL {
2626
2727// Common definitions
28- using CallOnceCallback = void (void );
2928namespace callonce_impl {
30- int callonce_slowpath (CallOnceFlag *flag, CallOnceCallback *callback);
29+ template <class CallOnceCallback >
30+ [[gnu::noinline]] int callonce_slowpath (CallOnceFlag *flag,
31+ CallOnceCallback callback);
3132} // namespace callonce_impl
3233
33- LIBC_INLINE int callonce (CallOnceFlag *flag, CallOnceCallback *callback) {
34+ template <class CallOnceCallback >
35+ LIBC_INLINE int callonce (CallOnceFlag *flag, CallOnceCallback callback) {
3436 if (LIBC_LIKELY (callonce_impl::callonce_fastpath (flag)))
3537 return 0 ;
3638
Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ namespace LIBC_NAMESPACE_DECL {
1717
1818LLVM_LIBC_FUNCTION (int , pthread_once,
1919 (pthread_once_t * flag, __pthread_once_func_t func)) {
20- return callonce (reinterpret_cast <CallOnceFlag *>(flag),
21- reinterpret_cast <CallOnceCallback *>(func));
20+ return callonce (reinterpret_cast <CallOnceFlag *>(flag), func);
2221}
2322
2423} // namespace LIBC_NAMESPACE_DECL
Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ namespace LIBC_NAMESPACE_DECL {
1717
1818LLVM_LIBC_FUNCTION (void , call_once,
1919 (once_flag * flag, __call_once_func_t func)) {
20- callonce (reinterpret_cast <CallOnceFlag *>(flag),
21- reinterpret_cast <CallOnceCallback *>(func));
20+ callonce (reinterpret_cast <CallOnceFlag *>(flag), func);
2221}
2322
2423} // namespace LIBC_NAMESPACE_DECL
You can’t perform that action at this time.
0 commit comments