mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
Piano: Guard against all allocations at top level of the audio pipeline
Therefore, we don't rely on LibDSP Processors to use allocation guards themselves. It also demonstrates that nested allocation guards work correctly :^)
This commit is contained in:
parent
59a9f8a958
commit
276be7f8cc
Notes:
sideshowbarker
2024-07-17 04:31:44 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/276be7f8cc Pull-request: https://github.com/SerenityOS/serenity/pull/16052
@ -9,6 +9,7 @@
|
||||
|
||||
#include "TrackManager.h"
|
||||
#include "Music.h"
|
||||
#include <AK/NoAllocationGuard.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/TypedTransfer.h>
|
||||
#include <LibDSP/Effects.h>
|
||||
@ -35,6 +36,7 @@ void TrackManager::time_forward(int amount)
|
||||
|
||||
void TrackManager::fill_buffer(FixedArray<DSP::Sample>& buffer)
|
||||
{
|
||||
NoAllocationGuard guard;
|
||||
VERIFY(buffer.size() == m_temporary_track_buffer.size());
|
||||
size_t sample_count = buffer.size();
|
||||
// No need to zero the temp buffer as the track overwrites it anyways.
|
||||
|
Loading…
Reference in New Issue
Block a user