ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
encoder_buffer_impl.cpp
Go to the documentation of this file.
2
4
6 if (size > this->capacity_) {
7 RAMAllocator<uint8_t> allocator;
8 uint8_t *p = allocator.reallocate(this->data_, size);
9 if (p == nullptr)
10 return false;
11
12 this->data_ = p;
13 this->capacity_ = size;
14 }
15 this->size_ = size;
16 return true;
17}
18
20 if (this->data_ != nullptr) {
21 RAMAllocator<uint8_t> allocator;
22 allocator.deallocate(this->data_, this->capacity_);
23 }
24}
25
26} // namespace esphome::camera_encoder
An STL allocator that uses SPI or internal RAM.
Definition helpers.h:1794
T * reallocate(T *p, size_t n)
Definition helpers.h:1830
void deallocate(T *p, size_t n)
Definition helpers.h:1849
size_t size
Definition helpers.h:854