mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:12:45 +00: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
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 kleines Filmröllchen
						kleines Filmröllchen