fix: Add missing ByteUtilities.h include and use coroStackSize constant

- Include ByteUtilities.h in Coro.ipp so megabytes() is declared
- Use coroStackSize constant in coroutine constructor instead of
  hardcoded 1536*1024, enabling sanitizer-aware stack sizing
- Initialize local variable in PropertyStream destructor to satisfy
  clang-tidy cppcoreguidelines-init-variables

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-03-18 16:46:18 +00:00
parent cc51d5430b
commit 018fe98696
2 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <xrpl/basics/ByteUtilities.h>
#include <cstddef>
namespace xrpl {
@@ -25,9 +27,7 @@ JobQueue::Coro::Coro(Coro_create_t, JobQueue& jq, JobType type, std::string cons
, name_(name)
, running_(false)
, coro_(
// Stack size of 1MB wasn't sufficient for deep calls. ASAN tests flagged the issue. Hence
// increasing the size to 1.5MB.
boost::context::protected_fixedsize_stack(1536 * 1024),
boost::context::protected_fixedsize_stack(coroStackSize),
[this, fn = std::forward<F>(f)](
boost::coroutines2::asymmetric_coroutine<void>::push_type& do_yield) {
yield_ = &do_yield;

View File

@@ -161,7 +161,7 @@ PropertyStream::Source::~Source()
// Read parent_ under lock, then release before calling remove()
// to maintain consistent lock ordering (parent before child),
// matching the order used in find_one_deep().
Source* parent;
Source* parent = nullptr;
{
std::lock_guard _(lock_);
parent = parent_;