Exceptions in @nogc code

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 2 14:53:36 PDT 2017


On 4/2/2017 2:05 PM, ketmar wrote:
> 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

Yes, you're right.


More information about the Digitalmars-d mailing list