[online_image] Use RAMAllocator (#8114)

This commit is contained in:
guillempages 2025-01-19 23:16:37 +01:00 committed by GitHub
parent 47a0ec467a
commit 75026be951
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -100,7 +100,7 @@ class DownloadBuffer {
void reset() { this->unread_ = 0; }
protected:
ExternalRAMAllocator<uint8_t> allocator_;
RAMAllocator<uint8_t> allocator_{};
uint8_t *buffer_;
size_t size_;
/** Total number of downloaded bytes not yet read. */

View File

@ -83,8 +83,7 @@ class OnlineImage : public PollingComponent,
protected:
bool validate_url_(const std::string &url);
using Allocator = ExternalRAMAllocator<uint8_t>;
Allocator allocator_{Allocator::Flags::ALLOW_FAILURE};
RAMAllocator<uint8_t> allocator_{};
uint32_t get_buffer_size_() const { return get_buffer_size_(this->buffer_width_, this->buffer_height_); }
int get_buffer_size_(int width, int height) const { return (this->get_bpp() * width + 7u) / 8u * height; }