Exceptions in @nogc code

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 2 14:05:39 PDT 2017


Walter Bright wrote:

> 1. If the thrown object was not allocated with the GC (such as if it was 
> 'emplaced'), then doing a GC free on it at the catch site will corrupt 
> memory.

no, it won't. it is completely safe to free non-GC-owned memory with GC[0].

[0] http://dpldocs.info/experimental-docs/core.memory.GC.free.html


More information about the Digitalmars-d mailing list