From f7de7fa4e39f163cfe11f061601b2c8cf06e14bb Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 17 Oct 2008 08:32:42 +0000 Subject: [PATCH] Add throw() to the nogrow new operator. This will cause the right version to be used that handles NULL returns and doesn't expect an exception. This fixes that certain constructors would still be called even if the allocation failed in low memory situations. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28208 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/heap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/private/kernel/heap.h b/headers/private/kernel/heap.h index d2daa6983d..9e514297f6 100644 --- a/headers/private/kernel/heap.h +++ b/headers/private/kernel/heap.h @@ -79,7 +79,7 @@ static const struct nogrow_t { } nogrow = {}; inline void* -operator new(size_t size, const nogrow_t& nogrow) +operator new(size_t size, const nogrow_t& nogrow) throw() { return malloc_nogrow(size); }