From b4625aaf826f8a3ee004ab3503fd9309b4c95a77 Mon Sep 17 00:00:00 2001 From: maciejmakowski2003 Date: Thu, 19 Mar 2026 18:59:59 +0100 Subject: [PATCH] feat: integrated new memory disposer --- .../effects/ConvolverNodeHostObject.cpp | 8 +- .../cpp/audioapi/core/BaseAudioContext.cpp | 9 ++- .../cpp/audioapi/core/BaseAudioContext.h | 5 +- .../audioapi/core/effects/ConvolverNode.cpp | 28 +++++-- .../cpp/audioapi/core/effects/ConvolverNode.h | 4 +- .../sources/AudioBufferQueueSourceNode.cpp | 14 ++-- .../core/sources/AudioBufferSourceNode.cpp | 10 ++- .../audioapi/core/utils/AudioDestructor.hpp | 74 ------------------- .../audioapi/core/utils/AudioGraphManager.cpp | 15 +--- .../audioapi/core/utils/AudioGraphManager.h | 22 ++---- .../core/utils/{graph => }/Disposer.hpp | 11 ++- .../cpp/audioapi/core/utils/graph/Graph.hpp | 2 +- .../audioapi/core/utils/graph/HostGraph.hpp | 2 +- .../cpp/test/src/graph/HostGraphTest.cpp | 2 +- 14 files changed, 71 insertions(+), 135 deletions(-) delete mode 100644 packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioDestructor.hpp rename packages/react-native-audio-api/common/cpp/audioapi/core/utils/{graph => }/Disposer.hpp (95%) diff --git a/packages/react-native-audio-api/common/cpp/audioapi/HostObjects/effects/ConvolverNodeHostObject.cpp b/packages/react-native-audio-api/common/cpp/audioapi/HostObjects/effects/ConvolverNodeHostObject.cpp index ba939cefa..383a00f49 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/HostObjects/effects/ConvolverNodeHostObject.cpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/HostObjects/effects/ConvolverNodeHostObject.cpp @@ -67,17 +67,17 @@ void ConvolverNodeHostObject::setBuffer(const std::shared_ptr &buff } auto threadPool = std::make_shared(4); - std::vector convolvers; + std::vector> convolvers; for (size_t i = 0; i < copiedBuffer->getNumberOfChannels(); ++i) { AudioArray channelData(*copiedBuffer->getChannel(i)); convolvers.emplace_back(); - convolvers.back().init(RENDER_QUANTUM_SIZE, channelData, copiedBuffer->getSize()); + convolvers.back()->init(RENDER_QUANTUM_SIZE, channelData, copiedBuffer->getSize()); } if (copiedBuffer->getNumberOfChannels() == 1) { // add one more convolver, because right now input is always stereo AudioArray channelData(*copiedBuffer->getChannel(0)); convolvers.emplace_back(); - convolvers.back().init(RENDER_QUANTUM_SIZE, channelData, copiedBuffer->getSize()); + convolvers.back()->init(RENDER_QUANTUM_SIZE, channelData, copiedBuffer->getSize()); } auto internalBuffer = std::make_shared( @@ -87,7 +87,7 @@ void ConvolverNodeHostObject::setBuffer(const std::shared_ptr &buff struct SetupData { std::shared_ptr buffer; - std::vector convolvers; + std::vector> convolvers; std::shared_ptr threadPool; std::shared_ptr internalBuffer; std::shared_ptr intermediateBuffer; diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.cpp b/packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.cpp index 67e4013e0..7d5ac63c1 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.cpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.cpp @@ -38,10 +38,11 @@ BaseAudioContext::BaseAudioContext( const RuntimeRegistry &runtimeRegistry) : state_(ContextState::SUSPENDED), sampleRate_(sampleRate), - graphManager_(std::make_shared()), audioEventHandlerRegistry_(audioEventHandlerRegistry), runtimeRegistry_(runtimeRegistry), - audioEventScheduler_(AUDIO_SCHEDULER_CAPACITY) {} + audioEventScheduler_(AUDIO_SCHEDULER_CAPACITY), + disposer_(std::make_shared>(AUDIO_SCHEDULER_CAPACITY)), + graphManager_(std::make_shared(disposer_)) {} void BaseAudioContext::initialize() { destination_ = std::make_shared(shared_from_this()); @@ -256,4 +257,8 @@ const RuntimeRegistry &BaseAudioContext::getRuntimeRegistry() const { return runtimeRegistry_; } +std::shared_ptr> BaseAudioContext::getDisposer() const { + return disposer_; +} + } // namespace audioapi diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.h b/packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.h index e3f52fd28..23a72ab07 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.h +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.h @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -107,6 +108,7 @@ class BaseAudioContext : public std::enable_shared_from_this { std::shared_ptr getGraphManager() const; std::shared_ptr getAudioEventHandlerRegistry() const; const RuntimeRegistry &getRuntimeRegistry() const; + std::shared_ptr> getDisposer() const; virtual void initialize(); @@ -131,7 +133,6 @@ class BaseAudioContext : public std::enable_shared_from_this { private: std::atomic state_; std::atomic sampleRate_; - std::shared_ptr graphManager_; std::shared_ptr audioEventHandlerRegistry_; RuntimeRegistry runtimeRegistry_; @@ -142,6 +143,8 @@ class BaseAudioContext : public std::enable_shared_from_this { static constexpr size_t AUDIO_SCHEDULER_CAPACITY = 1024; CrossThreadEventScheduler audioEventScheduler_; + std::shared_ptr> disposer_; + std::shared_ptr graphManager_; [[nodiscard]] virtual bool isDriverRunning() const = 0; }; diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.cpp b/packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.cpp index d2bf43911..e24fd348f 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.cpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.cpp @@ -27,7 +27,7 @@ ConvolverNode::ConvolverNode( void ConvolverNode::setBuffer( const std::shared_ptr &buffer, - std::vector convolvers, + std::vector> convolvers, const std::shared_ptr &threadPool, const std::shared_ptr &internalBuffer, const std::shared_ptr &intermediateBuffer, @@ -39,11 +39,25 @@ void ConvolverNode::setBuffer( auto graphManager = context->getGraphManager(); - if (buffer_) { - graphManager->addAudioBufferForDestruction(std::move(buffer_)); + if (buffer_ != nullptr) { + context->getDisposer()->dispose(std::move(buffer_)); } - // TODO move convolvers, thread pool and DSPAudioBuffers destruction to graph manager as well + if (threadPool_ != nullptr) { + context->getDisposer()->dispose(std::move(threadPool_)); + } + + for (auto it = convolvers_.begin(); it != convolvers_.end(); ++it) { + context->getDisposer()->dispose(std::move(*it)); + } + + if (internalBuffer_ != nullptr) { + context->getDisposer()->dispose(std::move(internalBuffer_)); + } + + if (intermediateBuffer_ != nullptr) { + context->getDisposer()->dispose(std::move(intermediateBuffer_)); + } buffer_ = buffer; convolvers_ = std::move(convolvers); @@ -86,7 +100,7 @@ void ConvolverNode::onInputDisabled() { numberOfEnabledInputNodes_ -= 1; if (isEnabled() && numberOfEnabledInputNodes_ == 0) { signalledToStop_ = true; - remainingSegments_ = convolvers_.at(0).getSegCount(); + remainingSegments_ = convolvers_.at(0)->getSegCount(); } } @@ -144,7 +158,7 @@ void ConvolverNode::performConvolution(const std::shared_ptr &pr if (processingBuffer->getNumberOfChannels() == 1) { for (int i = 0; i < convolvers_.size(); ++i) { threadPool_->schedule([&, i] { - convolvers_[i].process( + convolvers_[i]->process( *processingBuffer->getChannel(0), *intermediateBuffer_->getChannel(i)); }); } @@ -160,7 +174,7 @@ void ConvolverNode::performConvolution(const std::shared_ptr &pr } for (int i = 0; i < convolvers_.size(); ++i) { threadPool_->schedule([this, i, inputChannelMap, outputChannelMap, &processingBuffer] { - convolvers_[i].process( + convolvers_[i]->process( *processingBuffer->getChannel(inputChannelMap[i]), *intermediateBuffer_->getChannel(outputChannelMap[i])); }); diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.h b/packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.h index 489fa191b..7f04e3d13 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.h +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.h @@ -27,7 +27,7 @@ class ConvolverNode : public AudioNode { /// @note Audio Thread only void setBuffer( const std::shared_ptr &buffer, - std::vector convolvers, + std::vector> convolvers, const std::shared_ptr &threadPool, const std::shared_ptr &internalBuffer, const std::shared_ptr &intermediateBuffer, @@ -58,7 +58,7 @@ class ConvolverNode : public AudioNode { // buffer to hold internal processed data std::shared_ptr internalBuffer_; // vectors of convolvers, one per channel - std::vector convolvers_; + std::vector> convolvers_; std::shared_ptr threadPool_; void performConvolution(const std::shared_ptr &processingBuffer); diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferQueueSourceNode.cpp b/packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferQueueSourceNode.cpp index 05abf41c5..260688e8e 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferQueueSourceNode.cpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferQueueSourceNode.cpp @@ -81,7 +81,7 @@ void AudioBufferQueueSourceNode::dequeueBuffer(const size_t bufferId) { auto graphManager = context->getGraphManager(); if (buffers_.front().first == bufferId) { - graphManager->addAudioBufferForDestruction(std::move(buffers_.front().second)); + context->getDisposer()->dispose(std::move(buffers_.front().second)); buffers_.pop_front(); vReadIndex_ = 0.0; return; @@ -91,7 +91,7 @@ void AudioBufferQueueSourceNode::dequeueBuffer(const size_t bufferId) { // And keep vReadIndex_ at the same position. for (auto it = std::next(buffers_.begin()); it != buffers_.end(); ++it) { if (it->first == bufferId) { - graphManager->addAudioBufferForDestruction(std::move(it->second)); + context->getDisposer()->dispose(std::move(it->second)); buffers_.erase(it); return; } @@ -102,7 +102,7 @@ void AudioBufferQueueSourceNode::dequeueBuffer(const size_t bufferId) { void AudioBufferQueueSourceNode::clearBuffers() { if (auto context = context_.lock()) { for (auto it = buffers_.begin(); it != buffers_.end(); ++it) { - context->getGraphManager()->addAudioBufferForDestruction(std::move(it->second)); + context->getDisposer()->dispose(std::move(it->second)); } buffers_.clear(); @@ -215,7 +215,7 @@ void AudioBufferQueueSourceNode::processWithoutInterpolation( buffers_.emplace_back(bufferId, tailBuffer_); addExtraTailFrames_ = false; } else { - context->getGraphManager()->addAudioBufferForDestruction(std::move(buffer)); + context->getDisposer()->dispose(std::move(buffer)); processingBuffer->zero(writeIndex, framesLeft); readIndex = 0; @@ -223,7 +223,7 @@ void AudioBufferQueueSourceNode::processWithoutInterpolation( } } - context->getGraphManager()->addAudioBufferForDestruction(std::move(buffer)); + context->getDisposer()->dispose(std::move(buffer)); data = buffers_.front(); bufferId = data.first; buffer = data.second; @@ -296,14 +296,14 @@ void AudioBufferQueueSourceNode::processWithInterpolation( sendOnBufferEndedEvent(bufferId, buffers_.empty()); if (buffers_.empty()) { - context->getGraphManager()->addAudioBufferForDestruction(std::move(buffer)); + context->getDisposer()->dispose(std::move(buffer)); processingBuffer->zero(writeIndex, framesLeft); vReadIndex_ = 0.0; break; } - context->getGraphManager()->addAudioBufferForDestruction(std::move(buffer)); vReadIndex_ = vReadIndex_ - buffer->getSize(); + context->getDisposer()->dispose(std::move(buffer)); data = buffers_.front(); bufferId = data.first; buffer = data.second; diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp b/packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp index e5bf7ec4a..0fce4ca90 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp @@ -58,10 +58,16 @@ void AudioBufferSourceNode::setBuffer( auto graphManager = context->getGraphManager(); if (buffer_ != nullptr) { - graphManager->addAudioBufferForDestruction(std::move(buffer_)); + context->getDisposer()->dispose(std::move(buffer_)); } - // TODO move DSPAudioBuffers destruction to graph manager as well + if (playbackRateBuffer_ != nullptr) { + context->getDisposer()->dispose(std::move(playbackRateBuffer_)); + } + + if (audioBuffer_ != nullptr) { + context->getDisposer()->dispose(std::move(audioBuffer_)); + } if (buffer == nullptr) { loopEnd_ = 0; diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioDestructor.hpp b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioDestructor.hpp deleted file mode 100644 index 28f768993..000000000 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioDestructor.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -namespace audioapi { - -/// @brief A generic class to offload object destruction to a separate thread. -/// @tparam T The type of object to be destroyed. -template -class AudioDestructor { - public: - AudioDestructor() : isExiting_(false) { - auto [sender, receiver] = channels::spsc::channel< - std::shared_ptr, - channels::spsc::OverflowStrategy::WAIT_ON_FULL, - channels::spsc::WaitStrategy::ATOMIC_WAIT>(kChannelCapacity); - sender_ = std::move(sender); - workerHandle_ = std::thread(&AudioDestructor::process, this, std::move(receiver)); - } - - ~AudioDestructor() { - isExiting_.store(true, std::memory_order_release); - - // We need to send a nullptr to unblock the receiver - sender_.send(nullptr); - if (workerHandle_.joinable()) { - workerHandle_.join(); - } - } - - /// @brief Adds an audio object to the deconstruction queue. - /// @param object The audio object to be deconstructed. - /// @return True if the node was successfully added, false otherwise. - /// @note audio object does NOT get moved out if it is not successfully added. - bool tryAddForDeconstruction(std::shared_ptr &&object) { - return sender_.try_send(std::move(object)) == channels::spsc::ResponseStatus::SUCCESS; - } - - private: - static constexpr size_t kChannelCapacity = 1024; - - std::thread workerHandle_; - std::atomic isExiting_; - - using SenderType = channels::spsc::Sender< - std::shared_ptr, - channels::spsc::OverflowStrategy::WAIT_ON_FULL, - channels::spsc::WaitStrategy::ATOMIC_WAIT>; - - using ReceiverType = channels::spsc::Receiver< - std::shared_ptr, - channels::spsc::OverflowStrategy::WAIT_ON_FULL, - channels::spsc::WaitStrategy::ATOMIC_WAIT>; - - SenderType sender_; - - /// @brief Processes audio objects for deconstruction. - /// @param receiver The receiver channel for incoming audio objects. - void process(ReceiverType &&receiver) { - auto rcv = std::move(receiver); - while (!isExiting_.load(std::memory_order_acquire)) { - rcv.receive(); - } - } -}; - -#undef AUDIO_NODE_DESTRUCTOR_SPSC_OPTIONS - -} // namespace audioapi diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioGraphManager.cpp b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioGraphManager.cpp index 1689fc6b6..0f6dffd92 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioGraphManager.cpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioGraphManager.cpp @@ -72,11 +72,11 @@ AudioGraphManager::Event::~Event() { } } -AudioGraphManager::AudioGraphManager() { +AudioGraphManager::AudioGraphManager(const std::shared_ptr> &disposer) + : disposer_(disposer) { sourceNodes_.reserve(kInitialCapacity); processingNodes_.reserve(kInitialCapacity); audioParams_.reserve(kInitialCapacity); - audioBuffers_.reserve(kInitialCapacity); auto channel_pair = channels::spsc::channel< std::unique_ptr, @@ -119,9 +119,8 @@ void AudioGraphManager::addPendingParamConnection( void AudioGraphManager::preProcessGraph() { settlePendingConnections(); - AudioGraphManager::prepareForDestruction(sourceNodes_, nodeDestructor_); - AudioGraphManager::prepareForDestruction(processingNodes_, nodeDestructor_); - AudioGraphManager::prepareForDestruction(audioBuffers_, bufferDestructor_); + prepareForDestruction(sourceNodes_); + prepareForDestruction(processingNodes_); } void AudioGraphManager::addProcessingNode(const std::shared_ptr &node) { @@ -151,11 +150,6 @@ void AudioGraphManager::addAudioParam(const std::shared_ptr ¶m) sender_.send(std::move(event)); } -void AudioGraphManager::addAudioBufferForDestruction(std::shared_ptr buffer) { - // direct access because this is called from the Audio thread - audioBuffers_.emplace_back(std::move(buffer)); -} - void AudioGraphManager::settlePendingConnections() { std::unique_ptr value; while (receiver_.try_receive(value) != channels::spsc::ResponseStatus::CHANNEL_EMPTY) { @@ -234,7 +228,6 @@ void AudioGraphManager::cleanup() { sourceNodes_.clear(); processingNodes_.clear(); audioParams_.clear(); - audioBuffers_.clear(); } } // namespace audioapi diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioGraphManager.h b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioGraphManager.h index 462fbddb0..dacdf45f1 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioGraphManager.h +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioGraphManager.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -59,7 +59,7 @@ class AudioGraphManager { ~Event(); }; - AudioGraphManager(); + explicit AudioGraphManager(const std::shared_ptr> &disposer); ~AudioGraphManager(); void preProcessGraph(); @@ -99,15 +99,10 @@ class AudioGraphManager { /// @note Should be only used from JavaScript/HostObjects thread void addAudioParam(const std::shared_ptr ¶m); - /// @brief Adds an audio buffer to the manager for destruction. - /// @note Called directly from the Audio thread (bypasses SPSC). - void addAudioBufferForDestruction(std::shared_ptr buffer); - void cleanup(); private: - AudioDestructor nodeDestructor_; - AudioDestructor bufferDestructor_; + const std::shared_ptr> disposer_; /// @brief Initial capacity for various node types for deletion /// @note Higher capacity decreases number of reallocations at runtime (can be easily adjusted to 128 if needed) @@ -120,10 +115,8 @@ class AudioGraphManager { std::vector> sourceNodes_; std::vector> processingNodes_; std::vector> audioParams_; - std::vector> audioBuffers_; channels::spsc::Receiver receiver_; - channels::spsc::Sender sender_; void settlePendingConnections(); @@ -154,11 +147,8 @@ class AudioGraphManager { return node.use_count() == 1; } - template - requires std::convertible_to - static void prepareForDestruction( - std::vector> &vec, - AudioDestructor &audioDestructor) { + template + void prepareForDestruction(std::vector> &vec) { if (vec.empty()) { return; } @@ -201,7 +191,7 @@ class AudioGraphManager { /// If we fail to add we can't safely remove the node from the vector /// so we swap it and advance begin cursor /// @note vec[i] does NOT get moved out if it is not successfully added. - if (!audioDestructor.tryAddForDeconstruction(std::move(vec[i]))) { + if (!disposer_->dispose(std::move(vec[i]))) { std::swap(vec[i], vec[begin]); begin++; } diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/Disposer.hpp b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/Disposer.hpp similarity index 95% rename from packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/Disposer.hpp rename to packages/react-native-audio-api/common/cpp/audioapi/core/utils/Disposer.hpp index 7b2e6f030..6a1883f54 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/Disposer.hpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/Disposer.hpp @@ -4,12 +4,11 @@ #include #include -#include #include #include #include -namespace audioapi::utils::graph { +namespace audioapi::utils { /// @brief A disposal payload that can hold any trivially-relocatable or /// move-constructible type up to N bytes. The value is moved into a raw byte @@ -22,7 +21,7 @@ struct DisposalPayload { void (*destructor)(void *); // type-erased destructor /// @brief Sentinel check — a null destructor means "shutdown". - bool isSentinel() const; + [[nodiscard]] bool isSentinel() const; /// @brief Creates a sentinel payload used to signal worker thread shutdown. static DisposalPayload sentinel(); @@ -139,9 +138,9 @@ DisposerImpl::DisposerImpl(size_t channelCapacity) { auto [sender, receiver] = channel(channelCapacity); sender_ = std::move(sender); - workerHandle_ = std::thread([receiver = std::move(receiver)]() mutable { + workerHandle_ = std::thread([receiver_ = std::move(receiver)]() mutable { while (true) { - auto payload = receiver.receive(); + auto payload = receiver_.receive(); if (payload.isSentinel()) { break; } @@ -163,4 +162,4 @@ bool DisposerImpl::doDispose(DisposalPayload &&payload) { return sender_.try_send(std::move(payload)) == audioapi::channels::spsc::ResponseStatus::SUCCESS; } -} // namespace audioapi::utils::graph +} // namespace audioapi::utils diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/Graph.hpp b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/Graph.hpp index 269f32476..0f537d92e 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/Graph.hpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/Graph.hpp @@ -1,7 +1,7 @@ #pragma once +#include #include -#include #include #include diff --git a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/HostGraph.hpp b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/HostGraph.hpp index c785248a5..0d9dd73b8 100644 --- a/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/HostGraph.hpp +++ b/packages/react-native-audio-api/common/cpp/audioapi/core/utils/graph/HostGraph.hpp @@ -1,7 +1,7 @@ #pragma once +#include #include -#include #include #include #include diff --git a/packages/react-native-audio-api/common/cpp/test/src/graph/HostGraphTest.cpp b/packages/react-native-audio-api/common/cpp/test/src/graph/HostGraphTest.cpp index e796c0003..7ee9457a9 100644 --- a/packages/react-native-audio-api/common/cpp/test/src/graph/HostGraphTest.cpp +++ b/packages/react-native-audio-api/common/cpp/test/src/graph/HostGraphTest.cpp @@ -1,5 +1,5 @@ +#include #include -#include #include #include #include