< prev index next >

test/hotspot/gtest/metaspace/test_arenagrowthpolicy.cpp

Print this page
rev 60811 : imported patch jep387-all.patch
rev 60812 : [mq]: diff1

*** 1,8 **** /* ! * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 2018, 2020 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,8 ---- /* ! * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 2020 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 23,35 **** * */ #include "precompiled.hpp" //#define LOG_PLEASE ! #include "metaspaceTestsCommon.hpp" static void test_arena_growth_policy(Metaspace::MetaspaceType spacetype, bool is_class) { const ArenaGrowthPolicy* a = ArenaGrowthPolicy::policy_for_space_type((Metaspace::MetaspaceType)spacetype, is_class); --- 23,42 ---- * */ #include "precompiled.hpp" + #include "memory/metaspace.hpp" + #include "memory/metaspace/msArenaGrowthPolicy.hpp" + #include "memory/metaspace/msChunklevel.hpp" + //#define LOG_PLEASE + #include "metaspaceGtestCommon.hpp" ! using metaspace::ArenaGrowthPolicy; ! using metaspace::chunklevel_t; ! using namespace metaspace::chunklevel; static void test_arena_growth_policy(Metaspace::MetaspaceType spacetype, bool is_class) { const ArenaGrowthPolicy* a = ArenaGrowthPolicy::policy_for_space_type((Metaspace::MetaspaceType)spacetype, is_class);
*** 40,50 **** if (spacetype != Metaspace::BootMetaspaceType) { // All types save boot loader should start with small or very small chunks ASSERT_GE(lvl, CHUNK_LEVEL_4K); } ! for (int step = 1; step < 100; step ++) { chunklevel_t lvl2 = a->get_level_at_step(step); ASSERT_TRUE(is_valid_level(lvl2)); // limit steepness: no growth allowed beyond last chunksize * 2 ASSERT_LE(word_size_for_level(lvl2), word_size_for_level(lvl) * 2); lvl = lvl2; --- 47,57 ---- if (spacetype != Metaspace::BootMetaspaceType) { // All types save boot loader should start with small or very small chunks ASSERT_GE(lvl, CHUNK_LEVEL_4K); } ! for (int step = 1; step < 100; step++) { chunklevel_t lvl2 = a->get_level_at_step(step); ASSERT_TRUE(is_valid_level(lvl2)); // limit steepness: no growth allowed beyond last chunksize * 2 ASSERT_LE(word_size_for_level(lvl2), word_size_for_level(lvl) * 2); lvl = lvl2;
*** 63,71 **** DEFINE_GROWTH_POLICY_TEST(StandardMetaspaceType, true) DEFINE_GROWTH_POLICY_TEST(StandardMetaspaceType, false) DEFINE_GROWTH_POLICY_TEST(BootMetaspaceType, true) DEFINE_GROWTH_POLICY_TEST(BootMetaspaceType, false) - - - - --- 70,74 ----
< prev index next >