Possibility of non stop-the-world GC in the future?

John Colvin john.loughran.colvin at gmail.com
Tue Feb 19 04:03:48 PST 2013


On Monday, 18 February 2013 at 18:00:58 UTC, Benjamin Thaut wrote:
> Am 18.02.2013 18:49, schrieb JoeCoder:
>>
>> 1.  A @nogc attribute.  This would work similarly to 
>> pure/safe/nothrow
>> and would check at compile time that annotated functions or 
>> any they
>> call allocate any memory enforced by the GC.  Then phobos 
>> would no
>> longer be a "landmine" for those with realtime requirements.
>>
>
> I really would love to have that too. The problem with this 
> still would be exceptions because D throws by reference and not 
> by value like C++. To make this work there would be the need to 
> add a special Exception allocator and make the compiler emit 
> delete calls in case the exception is caught and not rethrown 
> or something similar.
>
> Kind Regards
> Benjamin Thaut

perhaps a @nogc attribute that forbade everything *except* 
exceptions to use the GC would be still useful. After all, 
exceptions probably aren't going to be used in the normal 
execution path of high performance code.


More information about the Digitalmars-d mailing list