Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out --enable-tracy-memory-tracking, disabled by default #4512

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,14 @@ if test x"$enable_tracy" = xyes; then
fi
AC_SUBST(tracy_CFLAGS)

AC_ARG_ENABLE(tracy-memory-tracking,
AS_HELP_STRING([--enable-tracy-memory-tracking],
[Enable 'tracy' profiler/tracer memory tracking code (slow)]))
AM_CONDITIONAL(USE_TRACY_MEMORY_TRACKING, [test x$enable_tracy_memory_tracking = xyes])
if test x"$enable_tracy_memory_tracking" = xyes -a x"$enable_asan" = xyes; then
AC_MSG_ERROR([--enable-asan is not compatible with --enable-tracy-memory-tracking])
fi

AC_ARG_ENABLE(tracy-gui,
AS_HELP_STRING([--enable-tracy-gui],
[Enable 'tracy' profiler/tracer server GUI]))
Expand Down
10 changes: 6 additions & 4 deletions src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ checkStellarCoreMajorVersionProtocolIdentity()
}
}

#ifdef USE_TRACY
#ifdef USE_TRACY_MEMORY_TRACKING

#ifdef __has_feature
#if __has_feature(address_sanitizer)
Expand All @@ -290,7 +290,9 @@ checkStellarCoreMajorVersionProtocolIdentity()
#endif
#endif

#ifndef ASAN_ENABLED
#ifdef ASAN_ENABLED
#error "ASAN_ENABLED and USE_TRACY_MEMORY_TRACKING are mutually exclusive"
#else
void*
operator new(std::size_t count)
{
Expand Down Expand Up @@ -322,8 +324,8 @@ operator delete[](void* ptr) noexcept
TracySecureFree(ptr);
free(ptr);
}
#endif // ASAN_ENABLED
#endif // USE_TRACY
#endif // !ASAN_ENABLED
#endif // USE_TRACY_MEMORY_TRACKING

int
main(int argc, char* const* argv)
Expand Down
Loading