ESPHome 2025.9.1
Loading...
Searching...
No Matches
encoder_buffer_impl.cpp
Go to the documentation of this file.
2
4
6 if (size > this->capacity_) {
7 uint8_t *p = this->allocator_.reallocate(this->data_, size);
8 if (p == nullptr)
9 return false;
10
11 this->data_ = p;
12 this->capacity_ = size;
13 }
14 this->size_ = size;
15 return true;
16}
17
19 if (this->data_ != nullptr)
20 this->allocator_.deallocate(this->data_, this->capacity_);
21}
22
23} // namespace esphome::camera_encoder
T * reallocate(T *p, size_t n)
Definition helpers.h:887
void deallocate(T *p, size_t n)
Definition helpers.h:906