4 ms·
For what it's worth, cJSON does support a (global) allocator override, using cJSON_InitHooks(). Here's what I use on ESP32 to push allocation to SPIRAM: https:
by cibomahto 5y ago
For what it's worth, cJSON does support a (global) allocator override, using cJSON_InitHooks().
Here's what I use on ESP32 to push allocation to SPIRAM: https://gist.github.com/cibomahto/a29b6662847e13c61b47a194fad4ab11 https://gist.github.com/cibomahto/a29b6662847e13c61b47a194fa...
- qalmakka 5y agoYes, but I don't want to change the allocator for _all_ of cJSON - we often have to use third party libraries which rely on cJSON, shipped as binary blobs, which haven't been tested with that. Nlohmann gives you the ability to pick what allocator you want per instance instead globally, which I greatly prefer.