Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit a347d9e

Browse files
iivlevstellaraccident
authored andcommitted
Some minor performance improvements
1 parent 3c46c62 commit a347d9e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

bindings/cpp/include/wtf/macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
static std::string \
133133
__WTF_INTERNAL_UNIQUE(__wtf_func_name_) {__PRETTY_FUNCTION__}; \
134134
do { \
135-
__INTERNAL_WTF_NAMESPACE::platform::once_flag __WTF_INTERNAL_UNIQUE(__wtf_replaced_flag_); \
135+
static __INTERNAL_WTF_NAMESPACE::platform::once_flag __WTF_INTERNAL_UNIQUE(__wtf_replaced_flag_); \
136136
__INTERNAL_WTF_NAMESPACE::platform::call_once(__WTF_INTERNAL_UNIQUE(__wtf_replaced_flag_), []() { \
137137
std::replace(__WTF_INTERNAL_UNIQUE(__wtf_func_name_).begin(), \
138138
__WTF_INTERNAL_UNIQUE(__wtf_func_name_).end(), ':', '#'); \

bindings/cpp/include/wtf/platform/platform_aux_pthreads_threaded_inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ using once_flag = struct {
3535
};
3636

3737
template <class T>
38-
void call_once(once_flag& once, T func) {
38+
inline void call_once(once_flag& once, T func) {
3939
pthread_once(&once.flag, func);
4040
}
4141

bindings/cpp/include/wtf/platform/platform_aux_single_threaded_inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ using once_flag = struct {
5050
bool flag {false};
5151
};
5252
template <class T>
53-
void call_once(once_flag& once, T func) {
53+
inline void call_once(once_flag& once, T func) {
5454
if (!once.flag) {
5555
once.flag = true;
5656
func();

bindings/cpp/include/wtf/platform/platform_aux_std_threaded_inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ using atomic = std::atomic<T>;
2222

2323
using once_flag = std::once_flag;
2424
template <class Callable>
25-
void call_once(once_flag& flag, Callable&& f) {
25+
inline void call_once(once_flag& flag, Callable&& f) {
2626
std::call_once(flag, std::move(f));
2727
}
2828

0 commit comments

Comments
 (0)