Proposal: Exceptions and @nogc

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 3 15:20:23 PDT 2017


On 4/3/2017 2:31 PM, Jonathan M Davis via Digitalmars-d wrote:
> Yeah, the simple fact that you can't allocate exceptions in @nogc code is
> crippling to @nogc, and a lot of code that could otherwise be @nogc can't be
> because of exceptions - though the exception message poses a similar problem
> (especially if you'd normally construct it with format), and I don't know
> how you get around that other than not using anything more informative than
> string literals. Unless I missed something, this proposal seems to ignore
> that particular issue.


You're right that this proposal does not address how memory is allocated for 
anything indirectly referenced by the exception object. That is an independent 
issue, and is not peculiar to exception objects.


More information about the Digitalmars-d mailing list