D3 - Programming in 3D

Luis luis.panadero at gmail.com
Tue Jun 16 10:57:03 UTC 2020


On Monday, 15 June 2020 at 22:30:23 UTC, Ernesto Castellotti 
wrote:
>
> Removing new 
> (https://dlang.org/spec/expression.html#new_expressions) and 
> replacing it with a library-based solution (such as 
> https://dlang.org/phobos/std_experimental_allocator.html)
> New is seen as the obligation to use the gc, we need a new 
> solution that includes the choice of allocator.
>
> I know that you can currently choose but it is not a great 
> marketing to propose two methods of allocating one of which 
> uses gc and the other would be excellent but it has been 
> "experimental" for years

You not need to removed new. Only to improve it. Again... I think 
that the approach that BeefLang did it's really good on this :

String AllocGlobalString(int len)
{
     return new String(len);
}
String AllocCustomString(int len)
{
     return new:customAllocator String(len);
}





More information about the Digitalmars-d mailing list