compilation fix

Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
This commit is contained in:
Pratik Mankawde
2026-02-19 15:36:03 +00:00
parent ad112399bb
commit 9a62a6d429
2 changed files with 16 additions and 4 deletions

View File

@@ -21,9 +21,14 @@ namespace test {
// Sanitizers significantly increase stack frame sizes
// (TSAN ~3-5x, ASAN ~2-3x), requiring larger coroutine stacks.
#if defined(__SANITIZE_THREAD__) || defined(__SANITIZE_ADDRESS__) || \
(defined(__has_feature) && (__has_feature(thread_sanitizer) || __has_feature(address_sanitizer)))
#if defined(__SANITIZE_THREAD__) || defined(__SANITIZE_ADDRESS__)
inline constexpr std::size_t yieldStackSize = 8 * 1024 * 1024;
#elif defined(__has_feature)
#if __has_feature(thread_sanitizer) || __has_feature(address_sanitizer)
inline constexpr std::size_t yieldStackSize = 8 * 1024 * 1024;
#else
inline constexpr std::size_t yieldStackSize = 2 * 1024 * 1024;
#endif
#else
inline constexpr std::size_t yieldStackSize = 2 * 1024 * 1024;
#endif

View File

@@ -2,13 +2,20 @@
#include <xrpl/basics/ByteUtilities.h>
#include <cstddef>
namespace xrpl {
// Sanitizers significantly increase stack frame sizes
// (TSAN ~3-5x, ASAN ~2-3x), requiring larger coroutine stacks.
#if defined(__SANITIZE_THREAD__) || defined(__SANITIZE_ADDRESS__) || \
(defined(__has_feature) && (__has_feature(thread_sanitizer) || __has_feature(address_sanitizer)))
#if defined(__SANITIZE_THREAD__) || defined(__SANITIZE_ADDRESS__)
inline constexpr std::size_t coroStackSize = megabytes(8);
#elif defined(__has_feature)
#if __has_feature(thread_sanitizer) || __has_feature(address_sanitizer)
inline constexpr std::size_t coroStackSize = megabytes(8);
#else
inline constexpr std::size_t coroStackSize = megabytes(1);
#endif
#else
inline constexpr std::size_t coroStackSize = megabytes(1);
#endif