List of Phobos functions that allocate memory?

Jerry jlquinn at optonline.net
Fri Feb 7 10:28:24 PST 2014


Walter Bright <newshound2 at digitalmars.com> writes:

> On 2/6/2014 6:19 PM, Andrei Alexandrescu wrote:
>> On 2/6/14, 5:23 PM, Walter Bright wrote:
>>> I'm tempted to say that the throw expression can call 'new' even if the
>>> function is marked as @nogc.
>>
>> That's extreme. A better possibility is to allocate exceptions from a different
>> heap and proclaim that the heap is cleaned once all catch blocks are left. (I'm
>> sure we can find something better, but now is not the time to worry about it.)
>
> That doesn't work, as nothing prevents code from squirreling away the caught
> exception object handle.

Very naive question (that may have already been answered), but why can't
throw use structs instead of classes?  Then the exception would
propagate by copy rather than passing the object up the stack?


More information about the Digitalmars-d mailing list