diff options
author | jwilhelm <none@none> | 2013-10-21 18:52:13 +0200 |
---|---|---|
committer | jwilhelm <none@none> | 2013-10-21 18:52:13 +0200 |
commit | a950a844d3d7d50218a82f883fe6c54013381987 (patch) | |
tree | 136ab74183c3a68dbeecbff12d9be9a088628b72 /src/share/vm/utilities | |
parent | 07cd754c26bde4160ed460b35c382dfdb288190b (diff) |
8026852: Use restricted_align_down in collector policy code
Summary: Moved restricted_align_down to globalDefinitions and renamed it align_size_down_bounded
Reviewed-by: stefank, mgerdin, tschatzl
Diffstat (limited to 'src/share/vm/utilities')
-rw-r--r-- | src/share/vm/utilities/globalDefinitions.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/share/vm/utilities/globalDefinitions.hpp b/src/share/vm/utilities/globalDefinitions.hpp index 06a32dc90..c558574eb 100644 --- a/src/share/vm/utilities/globalDefinitions.hpp +++ b/src/share/vm/utilities/globalDefinitions.hpp @@ -458,6 +458,13 @@ inline void* align_pointer_up(const void* addr, size_t size) { return (void*) align_size_up_((uintptr_t)addr, size); } +// Align down with a lower bound. If the aligning results in 0, return 'alignment'. + +inline size_t align_size_down_bounded(size_t size, size_t alignment) { + size_t aligned_size = align_size_down_(size, alignment); + return aligned_size > 0 ? aligned_size : alignment; +} + // Clamp an address to be within a specific page // 1. If addr is on the page it is returned as is // 2. If addr is above the page_address the start of the *next* page will be returned |