Skip to content

Commit

Permalink
Mark folly_async_stack_root_tls_key inline
Browse files Browse the repository at this point in the history
Summary:
I'm working on adding async stack trace support to Unifex and we'd like the
Unifex and Folly implementations to work together without either library
depending on the other. To that end, this diff marks
`folly_async_stack_root_tls_key` `inline` so that, when Unifex declares the same
global variable, also `inline`, the linker de-duplicates them rather than
failing with a duplicate symbol error.

Reviewed By: jesswong

Differential Revision: D57456364

fbshipit-source-id: f8a3b3dbde8fd3b912e4db37c19fccff9a695785
  • Loading branch information
ispeters authored and facebook-github-bot committed May 18, 2024
1 parent 12b8ea2 commit 1c9a5c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion third-party/folly/src/folly/tracing/AsyncStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
extern "C" {
// Current pthread implementation has valid keys in range 0 .. 1023.
// Initialise to some value that will be interpreted as an invalid key.
pthread_key_t folly_async_stack_root_tls_key = 0xFFFF'FFFFu;
inline pthread_key_t folly_async_stack_root_tls_key = 0xFFFF'FFFFu;
}

#endif // FOLLY_ASYNC_STACK_ROOT_USE_PTHREAD
Expand Down

0 comments on commit 1c9a5c5

Please sign in to comment.