Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8271242: add arena regression tests #4898

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/hotspot/share/memory/arena.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ class Arena : public CHeapObj<mtNone> {
void* Amalloc(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
x = ARENA_ALIGN(x); // note for 32 bits this should align _hwm as well.
debug_only(if (UseMallocOnly) return malloc(x);)
// JDK-8270308: Amalloc guarantees 64-bit alignment and we need to ensure that in case the preceding
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ignore, this belongs to JDK-8270308 which is waiting for final approval (#4835). Will be removed before pushing.

// allocation was AmallocWords. Note though that padding plays havoc with arenas holding packed arrays,
// like HandleAreas. Those areas should never mix Amalloc.. calls with differing alignment.
#ifndef LP64 // Since this is a hot path, and on 64-bit Amalloc and AmallocWords are identical, restrict this alignment to 32-bit.
if (x > 0) {
_hwm = ARENA_ALIGN(_hwm);
_hwm = MIN2(_hwm, _max); // _max is not guaranteed to be 64 bit aligned.
}
#endif // !LP64
return internal_amalloc(x, alloc_failmode);
}

Expand Down
Loading