8153743: AllocateHeap() and ReallocateHeap() should use ALWAYSINLINE macro
Reviewed-by: dholmes, zgu
This commit is contained in:
parent
afc9349c93
commit
161976b05f
@ -28,6 +28,7 @@
|
|||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "services/memTracker.hpp"
|
#include "services/memTracker.hpp"
|
||||||
|
#include "utilities/globalDefinitions.hpp"
|
||||||
|
|
||||||
// Explicit C-heap memory management
|
// Explicit C-heap memory management
|
||||||
|
|
||||||
@ -63,18 +64,12 @@ inline char* AllocateHeap(size_t size, MEMFLAGS flags,
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __GNUC__
|
ALWAYSINLINE char* AllocateHeap(size_t size, MEMFLAGS flags,
|
||||||
__attribute__((always_inline))
|
|
||||||
#endif
|
|
||||||
inline char* AllocateHeap(size_t size, MEMFLAGS flags,
|
|
||||||
AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
|
AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
|
||||||
return AllocateHeap(size, flags, CURRENT_PC, alloc_failmode);
|
return AllocateHeap(size, flags, CURRENT_PC, alloc_failmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __GNUC__
|
ALWAYSINLINE char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag,
|
||||||
__attribute__((always_inline))
|
|
||||||
#endif
|
|
||||||
inline char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag,
|
|
||||||
AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
|
AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
|
||||||
char* p = (char*) os::realloc(old, size, flag, CURRENT_PC);
|
char* p = (char*) os::realloc(old, size, flag, CURRENT_PC);
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
|
@ -324,6 +324,6 @@ inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
|
|||||||
|
|
||||||
// Inlining support
|
// Inlining support
|
||||||
#define NOINLINE __attribute__ ((noinline))
|
#define NOINLINE __attribute__ ((noinline))
|
||||||
#define ALWAYSINLINE __attribute__ ((always_inline))
|
#define ALWAYSINLINE inline __attribute__ ((always_inline))
|
||||||
|
|
||||||
#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
|
#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
|
||||||
|
@ -279,6 +279,6 @@ inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
|
|||||||
|
|
||||||
// Inlining support
|
// Inlining support
|
||||||
#define NOINLINE
|
#define NOINLINE
|
||||||
#define ALWAYSINLINE __attribute__((always_inline))
|
#define ALWAYSINLINE inline __attribute__((always_inline))
|
||||||
|
|
||||||
#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_SPARCWORKS_HPP
|
#endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_SPARCWORKS_HPP
|
||||||
|
Loading…
Reference in New Issue
Block a user