Stack + Heap allocation store

Mathias LANG geod24 at gmail.com
Tue Jul 28 04:16:51 UTC 2020


On Monday, 27 July 2020 at 23:50:13 UTC, Per Nordlöw wrote:
> Walter's talk on DConf 2019 talks about a favorite design 
> pattern of his - a hybrid approach to memory allocation.
>
> A store first allocates on the stack and then when it grows too 
> large it moves the data to a heap allocation (array).
>
> I know such a struct is not hard to write but I ask anyway to 
> collect advice on writing it.
>
> Does Phobos have anything like that?
>
> What about code.dlang.org?

There's 
https://github.com/dlang/phobos/blob/master/std/internal/scopebuffer.d
However, beware, here be dragons.


More information about the Digitalmars-d mailing list