src/hotspot/share/memory/arena.cpp
changeset 48859 5a4d08efbad9
parent 47216 71c04702a3d5
child 49734 f946776e9354
--- a/src/hotspot/share/memory/arena.cpp	Wed Jan 31 16:10:23 2018 -0800
+++ b/src/hotspot/share/memory/arena.cpp	Fri Feb 02 09:34:11 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -299,23 +299,11 @@
 
   // dynamic memory type binding
 void* Arena::operator new(size_t size, MEMFLAGS flags) throw() {
-#ifdef ASSERT
-  void* p = (void*)AllocateHeap(size, flags, CALLER_PC);
-  if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p);
-  return p;
-#else
   return (void *) AllocateHeap(size, flags, CALLER_PC);
-#endif
 }
 
 void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw() {
-#ifdef ASSERT
-  void* p = os::malloc(size, flags, CALLER_PC);
-  if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p);
-  return p;
-#else
-  return os::malloc(size, flags, CALLER_PC);
-#endif
+  return (void*)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL);
 }
 
 void Arena::operator delete(void* p) {