2#ifdef ESPHOME_DEBUG_API
8#ifdef ESPHOME_DEBUG_API
10 if (drop > this->
size_) {
11 ESP_LOGE(
"api.buffer",
"drop_front: drop=%zu size=%u", drop, this->
size_);
24 (void) this->
data_.release();
25 this->
data_.reset(grown);
31 const size_t old_size = this->
size_;
32 if (!this->
resize(old_size + n))
34 return this->
data_.get() + old_size;
An STL allocator that uses SPI or internal RAM.
T * reallocate(T *p, size_t n)
uint8_t * append(size_t n)
Grow by n bytes; returns the new bytes, or nullptr on allocation failure.
RAMUniquePtr< uint8_t[]> data_
bool resize(size_t n) ESPHOME_ALWAYS_INLINE
Returns false if allocation fails; the buffer is left unchanged. No zero-fill.
void debug_check_drop_(size_t drop) const
static constexpr size_t MAX_SIZE