|
DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Buffer placement policy (DRAM vs PSRAM) + SPI DMA ping-pong index manager (DETWS_ENABLE_PSRAM_POOL). More...
Go to the source code of this file.
Buffer placement policy (DRAM vs PSRAM) + SPI DMA ping-pong index manager (DETWS_ENABLE_PSRAM_POOL).
An ESP32 with PSRAM has two heaps: fast internal DRAM (scarce, DMA-capable) and large external PSRAM (roomy, but not DMA-capable for most peripherals and slower). Serving big web assets / net buffers well means putting the large, cold buffers in PSRAM and keeping the small, hot, DMA buffers in DRAM, while always leaving an internal-DRAM reserve so the stack does not starve. That placement choice is a pure policy; the actual heap_caps_calloc(..., MALLOC_CAP_SPIRAM / MALLOC_CAP_DMA) is the app's.
This module is that policy (detws_psram_place) plus the classic SPI DMA ping-pong double-buffer bookkeeping (detws_pingpong_*): while DMA drains one buffer, the CPU fills the other, and a swap exchanges their roles. Pure, no heap, no stdlib, host-testable.
Definition in file psram_pool.h.