RFC: std.json sucessor

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 22 19:30:21 PDT 2014


On 8/22/2014 6:05 PM, Walter Bright wrote:
>> The problem is that it really depends on the use case and on the type of input
>> stream which approach is more efficient (storing the escaped version of a string
>> might require *two* allocations if the input range cannot be sliced and if the
>> decoded string is then requested by the parser). My current idea therefore is to
>> simply make this configurable, too.
>>
>> Enabling the use of custom allocators should be easily possible as an add-on
>> functionality later on. At least my suggestion would be to wait with this until
>> we have a finished std.allocator module.

Another possibility is to have the user pass in a resizeable buffer which then 
will be used to store the strings in as necessary.

One example is std.internal.scopebuffer. The nice thing about that is the user 
can use the stack for the storage, which works out to be very, very fast.


More information about the Digitalmars-d mailing list