Skip to content

Commit

Permalink
__PRETTY_FUNCTION__ -> __func__ in FOLLY_SAFE_CHECK
Browse files Browse the repository at this point in the history
Summary:
Storing the `__PRETTY_FUNCTION__` for logging has an unreasonable cost on (non-strippable) binary size for debug builds, as different template instantiation will produce long, demangled, and non-mergeable strings.

If necessary, all the information is retrievable from the debug info (even if the function is inlined), where it's stored in much more efficient form. So, switch to `__func__`, which is stripped.

Reviewed By: yfeldblum, luciang

Differential Revision: D27825136

fbshipit-source-id: d499084c7e7b24db1cd46aa2b03f4a590c6eddc3
  • Loading branch information
ot authored and facebook-github-bot committed Apr 17, 2021
1 parent a87085f commit 7c86b9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion folly/lang/SafeAssert.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if ((!d || ::folly::kIsDebug || ::folly::kIsSanitize) && \
!static_cast<bool>(expr)) { \
FOLLY_DETAIL_SAFE_CHECK_LINKAGE constexpr auto \
__folly_detail_safe_assert_fun = __PRETTY_FUNCTION__; \
__folly_detail_safe_assert_fun = __func__; \
FOLLY_DETAIL_SAFE_CHECK_LINKAGE constexpr ::folly::detail:: \
safe_assert_arg __folly_detail_safe_assert_arg{ \
FOLLY_PP_STRINGIZE(expr_s), \
Expand Down

0 comments on commit 7c86b9b

Please sign in to comment.