[haiku-development] Re: possible bad usage of "new" in haiku

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 03 Nov 2008 12:12:24 +0100 CET

Stephan Assmus <superstippi@xxxxxx> wrote:
> If you spot usage of new without std::nothrow in applications and 
> preflets, 
> I would not report all those, just within the kits. Otherwise we 
> would be 
> overwelmed with the reports. One more question though: What about 
> "new 
> BMessage"? AFAIU, BMessage has a custom allocator? Can nothrow be 
> ommited 
> there?

Yes, it must not be used there.
"new BMessage" can actually return NULL, and doesn't throw any 
exceptions. Looking at BBlockCache, I doubt this class has much use 
anymore, though; it's doesn't look to do better than our default 
allocator.

Bye,
   Axel.


Other related posts: