List of Phobos functions that allocate memory?

Jonathan M Davis jmdavisProg at gmx.com
Sat Feb 8 03:27:11 PST 2014


On Saturday, February 08, 2014 11:17:25 Jakob Ovrum wrote:
> On Saturday, 8 February 2014 at 11:05:38 UTC, Dmitry Olshansky
> wrote:>
> 
> > If both are thread-local and cached I see no problem whatsoever.
> > The thing is the current "default" of creating exception is
> > AWFUL.
> > And D stands for sane defaults and the simple path being good
> > last time I checked.
> 
> How is it not a problem? XException's fields (message, location
> etc) would be overwritten by the latest throw site, and its
> `next` field would point to itself.

Then we have multiple of them, or we new up another one when a second one is 
needed. Even if it were only the first exception which avoided the allocation, 
it would be a big gain, and in most cases, you're only going to get a single 
exception, or the exceptions will be of different types.

- Jonathan M Davis


More information about the Digitalmars-d mailing list