Skip to content

Commit 55af21f

Browse files
committed
make jvm exit gracefully
1 parent e94ad55 commit 55af21f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/hotspot/share/code/codeCache.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,9 @@ size_t CodeCache::freelists_length() {
11061106
void icache_init();
11071107

11081108
void CodeCache::initialize() {
1109+
if (!is_power_of_2(CodeCacheSegmentSize)) {
1110+
vm_exit_during_initialization(err_msg("CodeCacheSegmentSize should be a power of 2"));
1111+
}
11091112
assert(CodeCacheSegmentSize >= (uintx)CodeEntryAlignment, "CodeCacheSegmentSize must be large enough to align entry points");
11101113
#ifdef COMPILER2
11111114
assert(CodeCacheSegmentSize >= (uintx)OptoLoopAlignment, "CodeCacheSegmentSize must be large enough to align inner loops");

0 commit comments

Comments
 (0)