Custom allocator (e.g., ESP32 WROVER External RAM)
Created by: czuvich
First of all, this library is awesome! I am developing an Arduino ESP32 project using the WROVER module. The WROVER chip (https://www.adafruit.com/product/3384) supports external RAM (up to 4MB), and I'd like to use DynamicJsonBuffer to allocate memory to the external RAM module. I'm making calls to a JSON backend that returns large(ish) JSON responses, and ideally, I would like to reserve internal RAM for ESP32 core functions.
You can specify the memory strategy on the ESP32 for malloc calls to potentially use external RAM; however, the compiled ESP32 arduino core requires explicit allocation to external memory. I've created a custom allocator that uses the heap_caps_malloc(..., MALLOC_CAP_SPIRAM)
call; however, I don't think I can specify how to allocate the DynamicJsonBuffer internal allocations.
I know it's very platform specific, but 1) Is there a way to configure ArduinoJson to support ESP32 external allocation? 2) If not, it'd be great to have a way to do that :)