test/hotspot/gtest/memory/test_metachunk.cpp
changeset 51070 2f4c3cac8556
parent 50193 49c3e91c424f
equal deleted inserted replaced
51069:d5d5f6658b12 51070:2f4c3cac8556
     1 /*
     1 /*
     2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    58   EXPECT_EQ((uintptr_t*) metachunk + metachunk->size(), metachunk->end());
    58   EXPECT_EQ((uintptr_t*) metachunk + metachunk->size(), metachunk->end());
    59 
    59 
    60   // Check sizes
    60   // Check sizes
    61   EXPECT_EQ(metachunk->size(), metachunk->word_size());
    61   EXPECT_EQ(metachunk->size(), metachunk->word_size());
    62   EXPECT_EQ(pointer_delta(metachunk->end(), metachunk->bottom(),
    62   EXPECT_EQ(pointer_delta(metachunk->end(), metachunk->bottom(),
    63                 sizeof (MetaWord*)),
    63                           sizeof (MetaWord)),
    64             metachunk->word_size());
    64             metachunk->word_size());
    65 
    65 
    66   // Check usage
    66   // Check usage
    67   EXPECT_EQ(metachunk->used_word_size(), metachunk->overhead());
    67   EXPECT_EQ(metachunk->used_word_size(), metachunk->overhead());
    68   EXPECT_EQ(metachunk->word_size() - metachunk->used_word_size(),
    68   EXPECT_EQ(metachunk->word_size() - metachunk->used_word_size(),