volt-software / Ichor

C++20 Microservice Bootstrapping Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RapidJson serialization services

vinniefalco opened this issue · comments

I see you're using Beast... so I'll just throw this out there :)

https://github.com/boostorg/json

I had not come around to writing a RapidJson-specific memory allocator yet, which allows using it without any dynamic memory allocation. It looks like Boost.JSON uses memory_resource, which is already used a lot in Ichor as well. Do you have an example where I can pass in a custom memory_resource to boost.JSON?

Do you have an example where I can pass in a custom memory_resource to boost.JSON?

The documentation should cover every possible use-case, but you shouldn't need it, since Boost.JSON comes with a resource that lets you avoid allocation, and provides example code for achieving parsing and storage of JSON without dynamic allocation:

https://www.boost.org/doc/libs/develop/libs/json/doc/html/json/input_output.html#json.input_output.parsing.avoiding_dynamic_allocations

Perfect, thanks!