< prev index next >

test/hotspot/gtest/memory/test_spaceManager.cpp

Print this page
rev 50187 : imported patch metaspace-split
rev 50188 : [mq]: 8176808-split-metaspace-cpp-2


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #include "precompiled.hpp"
  25 #include "memory/metaspace/spaceManager.hpp"
  26 
  27 using metaspace::internals::SpaceManager;
  28 
  29 // The test function is only available in debug builds
  30 #ifdef ASSERT
  31 
  32 #include "unittest.hpp"
  33 
  34 
  35 static void test_adjust_initial_chunk_size(bool is_class) {
  36   const size_t smallest = SpaceManager::smallest_chunk_size(is_class);
  37   const size_t normal   = SpaceManager::small_chunk_size(is_class);
  38   const size_t medium   = SpaceManager::medium_chunk_size(is_class);
  39 
  40 #define do_test(value, expected, is_class_value)                                 \
  41     do {                                                                         \
  42       size_t v = value;                                                          \
  43       size_t e = expected;                                                       \
  44       assert(SpaceManager::adjust_initial_chunk_size(v, (is_class_value)) == e,  \
  45              "Expected: " SIZE_FORMAT " got: " SIZE_FORMAT, e, v);               \
  46     } while (0)
  47 




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #include "precompiled.hpp"
  25 #include "memory/metaspace/spaceManager.hpp"
  26 
  27 using metaspace::SpaceManager;
  28 
  29 // The test function is only available in debug builds
  30 #ifdef ASSERT
  31 
  32 #include "unittest.hpp"
  33 
  34 
  35 static void test_adjust_initial_chunk_size(bool is_class) {
  36   const size_t smallest = SpaceManager::smallest_chunk_size(is_class);
  37   const size_t normal   = SpaceManager::small_chunk_size(is_class);
  38   const size_t medium   = SpaceManager::medium_chunk_size(is_class);
  39 
  40 #define do_test(value, expected, is_class_value)                                 \
  41     do {                                                                         \
  42       size_t v = value;                                                          \
  43       size_t e = expected;                                                       \
  44       assert(SpaceManager::adjust_initial_chunk_size(v, (is_class_value)) == e,  \
  45              "Expected: " SIZE_FORMAT " got: " SIZE_FORMAT, e, v);               \
  46     } while (0)
  47 


< prev index next >