I have made a discovery

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 21 16:35:50 PDT 2015


On Tue, 21 Apr 2015 22:53:15 +0000, Martin Nowak wrote:

> On Saturday, 18 April 2015 at 15:24:27 UTC, w0rp wrote:
>> @nogc void main() {
>>     throw new Foo("Oh no!");
>> }
> 
> Though until https://issues.dlang.org/show_bug.cgi?id=14119 is resolved
> the tracehandler GC allocates anyhow.
> Why are malloc exceptions better then gc exceptions? Are you throwing so
> many of them that the GC becomes a bottleneck :)?

the idea is to avoid allocations alltogether. malloc is a sample, one can 
use statically allocated pool instead, for example. this way functions 
can throw, yet still be @nogc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150421/ac273db2/attachment.sig>


More information about the Digitalmars-d mailing list