comparison src/share/vm/memory/allocation.inline.hpp @ 12146:9758d9f36299

8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced Summary: declare all user-defined operator new()s within Hotspot code with the empty throw() exception specification Reviewed-by: coleenp, twisti, dholmes, hseigel, dcubed, kvn, ccheung Contributed-by: lois.foltan@oracle.com
author coleenp
date Thu, 29 Aug 2013 18:56:29 -0400
parents a837fa3d3f86
children 833b0f92429a
comparison
equal deleted inserted replaced
12145:cef1e56a4d88 12146:9758d9f36299
83 os::free(p, memflags); 83 os::free(p, memflags);
84 } 84 }
85 85
86 86
87 template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size, 87 template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size,
88 address caller_pc){ 88 address caller_pc) throw() {
89 void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC)); 89 void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC));
90 #ifdef ASSERT 90 #ifdef ASSERT
91 if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); 91 if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
92 #endif 92 #endif
93 return p; 93 return p;
94 } 94 }
95 95
96 template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size, 96 template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size,
97 const std::nothrow_t& nothrow_constant, address caller_pc) { 97 const std::nothrow_t& nothrow_constant, address caller_pc) throw() {
98 void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC), 98 void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC),
99 AllocFailStrategy::RETURN_NULL); 99 AllocFailStrategy::RETURN_NULL);
100 #ifdef ASSERT 100 #ifdef ASSERT
101 if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); 101 if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
102 #endif 102 #endif
103 return p; 103 return p;
104 } 104 }
105 105
106 template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size, 106 template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
107 address caller_pc){ 107 address caller_pc) throw() {
108 return CHeapObj<F>::operator new(size, caller_pc); 108 return CHeapObj<F>::operator new(size, caller_pc);
109 } 109 }
110 110
111 template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size, 111 template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
112 const std::nothrow_t& nothrow_constant, address caller_pc) { 112 const std::nothrow_t& nothrow_constant, address caller_pc) throw() {
113 return CHeapObj<F>::operator new(size, nothrow_constant, caller_pc); 113 return CHeapObj<F>::operator new(size, nothrow_constant, caller_pc);
114 } 114 }
115 115
116 template <MEMFLAGS F> void CHeapObj<F>::operator delete(void* p){ 116 template <MEMFLAGS F> void CHeapObj<F>::operator delete(void* p){
117 FreeHeap(p, F); 117 FreeHeap(p, F);