Mercurial > hg > truffle
comparison src/share/vm/memory/allocation.inline.hpp @ 10135:5a9fa2ba85f0
8012907: anti-delta fix for 8010992
Summary: anti-delta fix for 8010992 until 8012902 can be fixed
Reviewed-by: acorn, minqi, rdurbin
author | dcubed |
---|---|
date | Sun, 21 Apr 2013 20:41:04 -0700 |
parents | 6f817ce50129 |
children | 746b070f5022 |
comparison
equal
deleted
inserted
replaced
10130:6f817ce50129 | 10135:5a9fa2ba85f0 |
---|---|
80 } | 80 } |
81 | 81 |
82 | 82 |
83 template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size, | 83 template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size, |
84 address caller_pc){ | 84 address caller_pc){ |
85 #ifdef ASSERT | |
85 void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC)); | 86 void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC)); |
86 #ifdef ASSERT | |
87 if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); | 87 if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); |
88 return p; | |
89 #else | |
90 return (void *) AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC)); | |
88 #endif | 91 #endif |
89 return p; | |
90 } | 92 } |
91 | 93 |
92 template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size, | 94 template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size, |
93 const std::nothrow_t& nothrow_constant, address caller_pc) { | 95 const std::nothrow_t& nothrow_constant, address caller_pc) { |
96 #ifdef ASSERT | |
94 void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC), | 97 void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC), |
95 AllocFailStrategy::RETURN_NULL); | 98 AllocFailStrategy::RETURN_NULL); |
96 #ifdef ASSERT | |
97 if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); | 99 if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); |
100 return p; | |
101 #else | |
102 return (void *) AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC), | |
103 AllocFailStrategy::RETURN_NULL); | |
98 #endif | 104 #endif |
99 return p; | |
100 } | |
101 | |
102 template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size, | |
103 address caller_pc){ | |
104 return CHeapObj<F>::operator new(size, caller_pc); | |
105 } | |
106 | |
107 template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size, | |
108 const std::nothrow_t& nothrow_constant, address caller_pc) { | |
109 return CHeapObj<F>::operator new(size, nothrow_constant, caller_pc); | |
110 } | 105 } |
111 | 106 |
112 template <MEMFLAGS F> void CHeapObj<F>::operator delete(void* p){ | 107 template <MEMFLAGS F> void CHeapObj<F>::operator delete(void* p){ |
113 FreeHeap(p, F); | 108 FreeHeap(p, F); |
114 } | |
115 | |
116 template <MEMFLAGS F> void CHeapObj<F>::operator delete [](void* p){ | |
117 FreeHeap(p, F); | |
118 } | 109 } |
119 | 110 |
120 template <class E, MEMFLAGS F> | 111 template <class E, MEMFLAGS F> |
121 E* ArrayAllocator<E, F>::allocate(size_t length) { | 112 E* ArrayAllocator<E, F>::allocate(size_t length) { |
122 assert(_addr == NULL, "Already in use"); | 113 assert(_addr == NULL, "Already in use"); |