mirror of
https://github.com/esphome/esphome.git
synced 2025-08-03 17:07:54 +00:00
fix incorrect comment
This commit is contained in:
parent
52d6801618
commit
3cca7a6161
@ -15,9 +15,10 @@ struct SpiRamAllocator : ArduinoJson::Allocator {
|
|||||||
void deallocate(void *pointer) override {
|
void deallocate(void *pointer) override {
|
||||||
// ArduinoJson's Allocator interface doesn't provide the size parameter in deallocate.
|
// ArduinoJson's Allocator interface doesn't provide the size parameter in deallocate.
|
||||||
// RAMAllocator::deallocate() requires the size, which we don't have access to here.
|
// RAMAllocator::deallocate() requires the size, which we don't have access to here.
|
||||||
// Since RAMAllocator internally uses malloc/free for NONE mode (PSRAM allocation),
|
// RAMAllocator::deallocate implementation just calls free() regardless of whether
|
||||||
// it's safe to use free() directly. The memory was allocated via malloc in
|
// the memory was allocated with heap_caps_malloc or malloc.
|
||||||
// RAMAllocator::allocate() when using NONE mode.
|
// This is safe because ESP-IDF's heap implementation internally tracks the memory region
|
||||||
|
// and routes free() to the appropriate heap.
|
||||||
free(pointer); // NOLINT(cppcoreguidelines-owning-memory,cppcoreguidelines-no-malloc)
|
free(pointer); // NOLINT(cppcoreguidelines-owning-memory,cppcoreguidelines-no-malloc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user