# HG changeset patch # User ysuenaga # Date 1466551779 14400 # Node ID 314741ca98d50e055d32634cc758154e27bf5351 # Parent d0ad5220e91cb2f39e36bda510c33e495a5886e6 8153743: AllocateHeap() and ReallocateHeap() should use ALWAYSINLINE macro Reviewed-by: dholmes, zgu diff -r d0ad5220e91c -r 314741ca98d5 hotspot/src/share/vm/memory/allocation.inline.hpp --- a/hotspot/src/share/vm/memory/allocation.inline.hpp Tue Jun 21 19:25:41 2016 -0400 +++ b/hotspot/src/share/vm/memory/allocation.inline.hpp Tue Jun 21 19:29:39 2016 -0400 @@ -28,6 +28,7 @@ #include "runtime/atomic.inline.hpp" #include "runtime/os.hpp" #include "services/memTracker.hpp" +#include "utilities/globalDefinitions.hpp" // Explicit C-heap memory management @@ -63,18 +64,12 @@ return p; } -#ifdef __GNUC__ -__attribute__((always_inline)) -#endif -inline char* AllocateHeap(size_t size, MEMFLAGS flags, +ALWAYSINLINE char* AllocateHeap(size_t size, MEMFLAGS flags, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) { return AllocateHeap(size, flags, CURRENT_PC, alloc_failmode); } -#ifdef __GNUC__ -__attribute__((always_inline)) -#endif -inline char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag, +ALWAYSINLINE char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) { char* p = (char*) os::realloc(old, size, flag, CURRENT_PC); #ifdef ASSERT diff -r d0ad5220e91c -r 314741ca98d5 hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp --- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp Tue Jun 21 19:25:41 2016 -0400 +++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp Tue Jun 21 19:29:39 2016 -0400 @@ -324,6 +324,6 @@ // Inlining support #define NOINLINE __attribute__ ((noinline)) -#define ALWAYSINLINE __attribute__ ((always_inline)) +#define ALWAYSINLINE inline __attribute__ ((always_inline)) #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP diff -r d0ad5220e91c -r 314741ca98d5 hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp --- a/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp Tue Jun 21 19:25:41 2016 -0400 +++ b/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp Tue Jun 21 19:29:39 2016 -0400 @@ -279,6 +279,6 @@ // Inlining support #define NOINLINE -#define ALWAYSINLINE __attribute__((always_inline)) +#define ALWAYSINLINE inline __attribute__((always_inline)) #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_SPARCWORKS_HPP