From e6c33e62b5d746f1a45202a6ddc3ded8f933752e Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Tue, 11 Oct 2022 00:17:36 +0000 Subject: [PATCH] 8295014: Remove unnecessary explicit casts to void* in CHeapObjBase Reviewed-by: jsjolen, dholmes, stefank --- src/hotspot/share/memory/allocation.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/memory/allocation.hpp b/src/hotspot/share/memory/allocation.hpp index 5da4c686196..40fc6cb3882 100644 --- a/src/hotspot/share/memory/allocation.hpp +++ b/src/hotspot/share/memory/allocation.hpp @@ -177,49 +177,49 @@ void FreeHeap(void* p); class CHeapObjBase { public: ALWAYSINLINE void* operator new(size_t size, MEMFLAGS f) throw() { - return (void*)AllocateHeap(size, f); + return AllocateHeap(size, f); } ALWAYSINLINE void* operator new(size_t size, MEMFLAGS f, const NativeCallStack& stack) throw() { - return (void*)AllocateHeap(size, f, stack); + return AllocateHeap(size, f, stack); } ALWAYSINLINE void* operator new(size_t size, MEMFLAGS f, const std::nothrow_t&, const NativeCallStack& stack) throw() { - return (void*)AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL); + return AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL); } ALWAYSINLINE void* operator new(size_t size, MEMFLAGS f, const std::nothrow_t&) throw() { - return (void*)AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL); + return AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL); } ALWAYSINLINE void* operator new[](size_t size, MEMFLAGS f) throw() { - return (void*)AllocateHeap(size, f); + return AllocateHeap(size, f); } ALWAYSINLINE void* operator new[](size_t size, MEMFLAGS f, const NativeCallStack& stack) throw() { - return (void*)AllocateHeap(size, f, stack); + return AllocateHeap(size, f, stack); } ALWAYSINLINE void* operator new[](size_t size, MEMFLAGS f, const std::nothrow_t&, const NativeCallStack& stack) throw() { - return (void*)AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL); + return AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL); } ALWAYSINLINE void* operator new[](size_t size, MEMFLAGS f, const std::nothrow_t&) throw() { - return (void*)AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL); + return AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL); } void operator delete(void* p) { FreeHeap(p); }