json icon indicating copy to clipboard operation
json copied to clipboard

Using serializer with custom stateful allocation

Open kamrann opened this issue 2 years ago • 1 comments

I have a json value which I want to serialize to a string type which uses a custom allocator, and cannot allow the default global allocator to be used during the process either. It appears that the serializer class uses a stack internally which can allocate. It has a storage_ptr member, but I don't see any way to provide my own value for this, and so it is always using the default allocator when the stack needs to reserve more space.

Not sure if this is an oversight, or I'm missing something?

Boost 1.76.0 (appears to be same situation on master)

kamrann avatar Dec 15 '21 17:12 kamrann

I think, you are correct, we don't have a way to set memory resource for the serializer at the moment.

grisumbras avatar Dec 15 '21 17:12 grisumbras