Path: blob/master/src/hotspot/share/gc/shared/gcArguments.hpp
40957 views
/*1* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 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 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef SHARE_GC_SHARED_GCARGUMENTS_HPP26#define SHARE_GC_SHARED_GCARGUMENTS_HPP2728#include "memory/allocation.hpp"2930class CollectedHeap;3132extern size_t HeapAlignment;33extern size_t SpaceAlignment;3435class GCArguments {36protected:37// Initialize HeapAlignment, SpaceAlignment, and extra alignments (E.g. GenAlignment)38virtual void initialize_alignments() = 0;39virtual void initialize_heap_flags_and_sizes();40virtual void initialize_size_info();4142DEBUG_ONLY(void assert_flags();)43DEBUG_ONLY(void assert_size_info();)4445public:46virtual void initialize();47virtual size_t conservative_max_heap_alignment() = 0;4849// Used by heap size heuristics to determine max50// amount of address space to use for the heap.51virtual size_t heap_virtual_to_physical_ratio();5253virtual CollectedHeap* create_heap() = 0;5455// Allows GCs to tell external code if it's supported or not in the current setup.56virtual bool is_supported() const {57return true;58}5960void initialize_heap_sizes();6162static size_t compute_heap_alignment();63};6465#endif // SHARE_GC_SHARED_GCARGUMENTS_HPP666768