Skip to content

STL with AllocatorPSRAM

Phil Schatzmann edited this page Jun 11, 2025 · 2 revisions

Here are a couple of examples that show how you can allocate any STL container in PSRAM

#include "esp32-psram.h"
#include <vector>
#include <deque>

// A vector of int in PSRAM
std::vector<int, AllocatorPSRAM<int>> my_vector;
// A deque of int in PSRAM
std::deque<int, AllocatorPSRAM<int>> my_deque;
Clone this wiki locally