RFC: std.json sucessor

Ola Fosheim Gr via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 22 23:25:33 PDT 2014


On Saturday, 23 August 2014 at 05:28:55 UTC, Walter Bright wrote:
> On 8/22/2014 9:48 PM, Ola Fosheim Gr wrote:
>> On Saturday, 23 August 2014 at 04:36:34 UTC, Walter Bright 
>> wrote:
>>> On 8/22/2014 9:01 PM, Ola Fosheim Gr wrote:
>>>> Does this mean that D is getting resizable stack allocations 
>>>> in lower stack
>>>> frames? That has a lot of implications for code gen.
>>>
>>> scopebuffer does not require resizeable stack allocations.
>>
>> So you cannot use the stack for resizable allocations.
>
> Please, take a look at how scopebuffer works.

I have? It requires an upperbound to stay on the stack, that 
creates a big hole in the stack. I don't think wasting the stack 
or moving to the heap is a nice predictable solution. It would be 
better to just have a couple of regions that do "reverse" stack 
allocations, but the most efficient solution is the one I 
outlined.

With json you might be able to create an upperbound of say 4-8 
times the size of the source iff you know the file size. You 
don't if you are streaming.

(scopebuffer is too unpredictable for real time, a pure stack 
solution is predictable)


More information about the Digitalmars-d mailing list