memory management and the standard library

rikki cattermole rikki at cattermole.co.nz
Sun Mar 17 01:53:02 UTC 2019


On 17/03/2019 10:17 AM, Olivier FAURE wrote:
> 
> Anyway, it would be pretty nice if there were a standardized way to tell 
> a function how it should allocate its memory; it would allow some nice 
> strategies like "I know that I'm going to discard most of what this 
> function allocates, so just put in in a continuous buffer; then 
> deep-copy the relevant data to GC memory, and throw the rest away" (eg 
> in a parser).

I have questions related to how much garbage this parser is creating.

Ignoring how complex of an idea this actually is, we would need clear 
set of examples demonstrating that this cannot be done manually 
(choosing between GC and another allocator).

But otherwise, neat.


More information about the Digitalmars-d mailing list