mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 06:04:01 +00:00
Clean up RAMAllocators in audio related code (#9140)
This commit is contained in:
@@ -86,7 +86,7 @@ bool AudioTransferBuffer::reallocate(size_t new_buffer_size) {
|
||||
bool AudioTransferBuffer::allocate_buffer_(size_t buffer_size) {
|
||||
this->buffer_size_ = buffer_size;
|
||||
|
||||
RAMAllocator<uint8_t> allocator(ExternalRAMAllocator<uint8_t>::ALLOW_FAILURE);
|
||||
RAMAllocator<uint8_t> allocator;
|
||||
|
||||
this->buffer_ = allocator.allocate(this->buffer_size_);
|
||||
if (this->buffer_ == nullptr) {
|
||||
@@ -101,7 +101,7 @@ bool AudioTransferBuffer::allocate_buffer_(size_t buffer_size) {
|
||||
|
||||
void AudioTransferBuffer::deallocate_buffer_() {
|
||||
if (this->buffer_ != nullptr) {
|
||||
RAMAllocator<uint8_t> allocator(ExternalRAMAllocator<uint8_t>::ALLOW_FAILURE);
|
||||
RAMAllocator<uint8_t> allocator;
|
||||
allocator.deallocate(this->buffer_, this->buffer_size_);
|
||||
this->buffer_ = nullptr;
|
||||
this->data_start_ = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user