The D Programming Language Vision Document

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Jul 6 07:33:15 UTC 2022


On Tuesday, 5 July 2022 at 11:49:20 UTC, ryuukk_ wrote:
> I am sad that no word on the Allocator API, moving forward i 
> personally think APIs that use memory should be required to ask 
> for an Allocator and do their allocation using it, and only it
>
> A default GCAllocator could be used if none provided, this 
> allows users of all kind to enjoy the APIs without having to 
> complain about the GC or their inability to integrate the APIs 
> in their game engine for example

It should not be resolved like this. Functions that does not 
return memory should just be nogc.

Functions that return allocated memory that are nogc should use 
RAII and prevent GC pointers from pointing to it. So you need a 
new type system.

Or just overload on @system.

You also want to get rid of destructors on GC objects and replace 
it with a finalizer that isnt sensitive to order.






More information about the Digitalmars-d-announce mailing list