Skip to content

Commit e6c33e6

Browse files
author
Kim Barrett
committed
8295014: Remove unnecessary explicit casts to void* in CHeapObjBase
Reviewed-by: jsjolen, dholmes, stefank
1 parent 1bfcc27 commit e6c33e6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/hotspot/share/memory/allocation.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -177,49 +177,49 @@ void FreeHeap(void* p);
177177
class CHeapObjBase {
178178
public:
179179
ALWAYSINLINE void* operator new(size_t size, MEMFLAGS f) throw() {
180-
return (void*)AllocateHeap(size, f);
180+
return AllocateHeap(size, f);
181181
}
182182

183183
ALWAYSINLINE void* operator new(size_t size,
184184
MEMFLAGS f,
185185
const NativeCallStack& stack) throw() {
186-
return (void*)AllocateHeap(size, f, stack);
186+
return AllocateHeap(size, f, stack);
187187
}
188188

189189
ALWAYSINLINE void* operator new(size_t size,
190190
MEMFLAGS f,
191191
const std::nothrow_t&,
192192
const NativeCallStack& stack) throw() {
193-
return (void*)AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL);
193+
return AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL);
194194
}
195195

196196
ALWAYSINLINE void* operator new(size_t size,
197197
MEMFLAGS f,
198198
const std::nothrow_t&) throw() {
199-
return (void*)AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL);
199+
return AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL);
200200
}
201201

202202
ALWAYSINLINE void* operator new[](size_t size, MEMFLAGS f) throw() {
203-
return (void*)AllocateHeap(size, f);
203+
return AllocateHeap(size, f);
204204
}
205205

206206
ALWAYSINLINE void* operator new[](size_t size,
207207
MEMFLAGS f,
208208
const NativeCallStack& stack) throw() {
209-
return (void*)AllocateHeap(size, f, stack);
209+
return AllocateHeap(size, f, stack);
210210
}
211211

212212
ALWAYSINLINE void* operator new[](size_t size,
213213
MEMFLAGS f,
214214
const std::nothrow_t&,
215215
const NativeCallStack& stack) throw() {
216-
return (void*)AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL);
216+
return AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL);
217217
}
218218

219219
ALWAYSINLINE void* operator new[](size_t size,
220220
MEMFLAGS f,
221221
const std::nothrow_t&) throw() {
222-
return (void*)AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL);
222+
return AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL);
223223
}
224224

225225
void operator delete(void* p) { FreeHeap(p); }

0 commit comments

Comments
 (0)