@@ -33,14 +33,14 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s
3333 // Samples are set sequentially. For stereo audio they are passed L/R/L/R/...
3434 self -> buffer_len = buffer_size ; // in bytes
3535
36- self -> buffer [0 ] = m_malloc (self -> buffer_len );
36+ self -> buffer [0 ] = m_malloc_maybe (self -> buffer_len );
3737 if (self -> buffer [0 ] == NULL ) {
3838 common_hal_audiofreeverb_freeverb_deinit (self );
3939 m_malloc_fail (self -> buffer_len );
4040 }
4141 memset (self -> buffer [0 ], 0 , self -> buffer_len );
4242
43- self -> buffer [1 ] = m_malloc (self -> buffer_len );
43+ self -> buffer [1 ] = m_malloc_maybe (self -> buffer_len );
4444 if (self -> buffer [1 ] == NULL ) {
4545 common_hal_audiofreeverb_freeverb_deinit (self );
4646 m_malloc_fail (self -> buffer_len );
@@ -86,7 +86,7 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s
8686 self -> combbuffersizes [6 ] = self -> combbuffersizes [14 ] = 1557 ;
8787 self -> combbuffersizes [7 ] = self -> combbuffersizes [15 ] = 1617 ;
8888 for (uint32_t i = 0 ; i < 8 * channel_count ; i ++ ) {
89- self -> combbuffers [i ] = m_malloc (self -> combbuffersizes [i ] * sizeof (uint16_t ));
89+ self -> combbuffers [i ] = m_malloc_maybe (self -> combbuffersizes [i ] * sizeof (uint16_t ));
9090 if (self -> combbuffers [i ] == NULL ) {
9191 common_hal_audiofreeverb_freeverb_deinit (self );
9292 m_malloc_fail (self -> combbuffersizes [i ]);
@@ -104,7 +104,7 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s
104104 self -> allpassbuffersizes [2 ] = self -> allpassbuffersizes [6 ] = 341 ;
105105 self -> allpassbuffersizes [3 ] = self -> allpassbuffersizes [7 ] = 225 ;
106106 for (uint32_t i = 0 ; i < 4 * channel_count ; i ++ ) {
107- self -> allpassbuffers [i ] = m_malloc (self -> allpassbuffersizes [i ] * sizeof (uint16_t ));
107+ self -> allpassbuffers [i ] = m_malloc_maybe (self -> allpassbuffersizes [i ] * sizeof (uint16_t ));
108108 if (self -> allpassbuffers [i ] == NULL ) {
109109 common_hal_audiofreeverb_freeverb_deinit (self );
110110 m_malloc_fail (self -> allpassbuffersizes [i ]);
0 commit comments