1.1 --- a/src/share/vm/memory/allocation.cpp Wed Oct 16 10:52:41 2013 +0200 1.2 +++ b/src/share/vm/memory/allocation.cpp Tue Nov 05 17:38:04 2013 -0800 1.3 @@ -52,19 +52,19 @@ 1.4 # include "os_bsd.inline.hpp" 1.5 #endif 1.6 1.7 -void* StackObj::operator new(size_t size) { ShouldNotCallThis(); return 0; } 1.8 -void StackObj::operator delete(void* p) { ShouldNotCallThis(); } 1.9 -void* StackObj::operator new [](size_t size) { ShouldNotCallThis(); return 0; } 1.10 -void StackObj::operator delete [](void* p) { ShouldNotCallThis(); } 1.11 +void* StackObj::operator new(size_t size) throw() { ShouldNotCallThis(); return 0; } 1.12 +void StackObj::operator delete(void* p) { ShouldNotCallThis(); } 1.13 +void* StackObj::operator new [](size_t size) throw() { ShouldNotCallThis(); return 0; } 1.14 +void StackObj::operator delete [](void* p) { ShouldNotCallThis(); } 1.15 1.16 -void* _ValueObj::operator new(size_t size) { ShouldNotCallThis(); return 0; } 1.17 -void _ValueObj::operator delete(void* p) { ShouldNotCallThis(); } 1.18 -void* _ValueObj::operator new [](size_t size) { ShouldNotCallThis(); return 0; } 1.19 -void _ValueObj::operator delete [](void* p) { ShouldNotCallThis(); } 1.20 +void* _ValueObj::operator new(size_t size) throw() { ShouldNotCallThis(); return 0; } 1.21 +void _ValueObj::operator delete(void* p) { ShouldNotCallThis(); } 1.22 +void* _ValueObj::operator new [](size_t size) throw() { ShouldNotCallThis(); return 0; } 1.23 +void _ValueObj::operator delete [](void* p) { ShouldNotCallThis(); } 1.24 1.25 void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data, 1.26 size_t word_size, bool read_only, 1.27 - MetaspaceObj::Type type, TRAPS) { 1.28 + MetaspaceObj::Type type, TRAPS) throw() { 1.29 // Klass has it's own operator new 1.30 return Metaspace::allocate(loader_data, word_size, read_only, 1.31 type, CHECK_NULL); 1.32 @@ -83,7 +83,7 @@ 1.33 st->print(" {"INTPTR_FORMAT"}", this); 1.34 } 1.35 1.36 -void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) { 1.37 +void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() { 1.38 address res; 1.39 switch (type) { 1.40 case C_HEAP: 1.41 @@ -100,12 +100,12 @@ 1.42 return res; 1.43 } 1.44 1.45 -void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS flags) { 1.46 +void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS flags) throw() { 1.47 return (address) operator new(size, type, flags); 1.48 } 1.49 1.50 void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant, 1.51 - allocation_type type, MEMFLAGS flags) { 1.52 + allocation_type type, MEMFLAGS flags) throw() { 1.53 //should only call this with std::nothrow, use other operator new() otherwise 1.54 address res; 1.55 switch (type) { 1.56 @@ -124,7 +124,7 @@ 1.57 } 1.58 1.59 void* ResourceObj::operator new [](size_t size, const std::nothrow_t& nothrow_constant, 1.60 - allocation_type type, MEMFLAGS flags) { 1.61 + allocation_type type, MEMFLAGS flags) throw() { 1.62 return (address)operator new(size, nothrow_constant, type, flags); 1.63 } 1.64 1.65 @@ -373,7 +373,7 @@ 1.66 //-------------------------------------------------------------------------------------- 1.67 // Chunk implementation 1.68 1.69 -void* Chunk::operator new (size_t requested_size, AllocFailType alloc_failmode, size_t length) { 1.70 +void* Chunk::operator new (size_t requested_size, AllocFailType alloc_failmode, size_t length) throw() { 1.71 // requested_size is equal to sizeof(Chunk) but in order for the arena 1.72 // allocations to come out aligned as expected the size must be aligned 1.73 // to expected arena alignment. 1.74 @@ -481,18 +481,18 @@ 1.75 NOT_PRODUCT(Atomic::dec(&_instance_count);) 1.76 } 1.77 1.78 -void* Arena::operator new(size_t size) { 1.79 +void* Arena::operator new(size_t size) throw() { 1.80 assert(false, "Use dynamic memory type binding"); 1.81 return NULL; 1.82 } 1.83 1.84 -void* Arena::operator new (size_t size, const std::nothrow_t& nothrow_constant) { 1.85 +void* Arena::operator new (size_t size, const std::nothrow_t& nothrow_constant) throw() { 1.86 assert(false, "Use dynamic memory type binding"); 1.87 return NULL; 1.88 } 1.89 1.90 // dynamic memory type binding 1.91 -void* Arena::operator new(size_t size, MEMFLAGS flags) { 1.92 +void* Arena::operator new(size_t size, MEMFLAGS flags) throw() { 1.93 #ifdef ASSERT 1.94 void* p = (void*)AllocateHeap(size, flags|otArena, CALLER_PC); 1.95 if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p); 1.96 @@ -502,7 +502,7 @@ 1.97 #endif 1.98 } 1.99 1.100 -void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) { 1.101 +void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw() { 1.102 #ifdef ASSERT 1.103 void* p = os::malloc(size, flags|otArena, CALLER_PC); 1.104 if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p); 1.105 @@ -691,22 +691,22 @@ 1.106 // define ALLOW_OPERATOR_NEW_USAGE for platform on which global operator new allowed. 1.107 // 1.108 #ifndef ALLOW_OPERATOR_NEW_USAGE 1.109 -void* operator new(size_t size){ 1.110 +void* operator new(size_t size) throw() { 1.111 assert(false, "Should not call global operator new"); 1.112 return 0; 1.113 } 1.114 1.115 -void* operator new [](size_t size){ 1.116 +void* operator new [](size_t size) throw() { 1.117 assert(false, "Should not call global operator new[]"); 1.118 return 0; 1.119 } 1.120 1.121 -void* operator new(size_t size, const std::nothrow_t& nothrow_constant){ 1.122 +void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() { 1.123 assert(false, "Should not call global operator new"); 1.124 return 0; 1.125 } 1.126 1.127 -void* operator new [](size_t size, std::nothrow_t& nothrow_constant){ 1.128 +void* operator new [](size_t size, std::nothrow_t& nothrow_constant) throw() { 1.129 assert(false, "Should not call global operator new[]"); 1.130 return 0; 1.131 }