# HG changeset patch # User stefank # Date 1572258413 -3600 # Node ID bfb419c66ae97f2bdf12dd145110d2136186fc26 # Parent 67009d58dd7024e353693fec14f26300e9c9ddac 8232650: ZGC: Add initialization hooks for OS specific code Reviewed-by: pliden, eosterlund diff -r 67009d58dd70 -r bfb419c66ae9 src/hotspot/os/posix/gc/z/zInitialize_posix.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hotspot/os/posix/gc/z/zInitialize_posix.cpp Mon Oct 28 11:26:53 2019 +0100 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" +#include "gc/z/zInitialize.hpp" + +void ZInitialize::initialize_os() { + // Does nothing +} diff -r 67009d58dd70 -r bfb419c66ae9 src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp --- a/src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp Mon Oct 28 11:26:00 2019 +0100 +++ b/src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp Mon Oct 28 11:26:53 2019 +0100 @@ -29,6 +29,10 @@ #include #include +void ZVirtualMemoryManager::initialize_os() { + // Does nothing +} + static void unmap(uintptr_t start, size_t size) { const int res = munmap((void*)start, size); assert(res == 0, "Failed to unmap memory"); diff -r 67009d58dd70 -r bfb419c66ae9 src/hotspot/share/gc/z/zInitialize.cpp --- a/src/hotspot/share/gc/z/zInitialize.cpp Mon Oct 28 11:26:00 2019 +0100 +++ b/src/hotspot/share/gc/z/zInitialize.cpp Mon Oct 28 11:26:53 2019 +0100 @@ -50,4 +50,6 @@ ZTracer::initialize(); ZLargePages::initialize(); ZBarrierSet::set_barrier_set(barrier_set); + + initialize_os(); } diff -r 67009d58dd70 -r bfb419c66ae9 src/hotspot/share/gc/z/zInitialize.hpp --- a/src/hotspot/share/gc/z/zInitialize.hpp Mon Oct 28 11:26:00 2019 +0100 +++ b/src/hotspot/share/gc/z/zInitialize.hpp Mon Oct 28 11:26:53 2019 +0100 @@ -29,6 +29,9 @@ class ZBarrierSet; class ZInitialize { +private: + void initialize_os(); + public: ZInitialize(ZBarrierSet* barrier_set); }; diff -r 67009d58dd70 -r bfb419c66ae9 src/hotspot/share/gc/z/zVirtualMemory.cpp --- a/src/hotspot/share/gc/z/zVirtualMemory.cpp Mon Oct 28 11:26:00 2019 +0100 +++ b/src/hotspot/share/gc/z/zVirtualMemory.cpp Mon Oct 28 11:26:53 2019 +0100 @@ -47,6 +47,9 @@ return; } + // Initialize OS specific parts + initialize_os(); + // Successfully initialized _initialized = true; } diff -r 67009d58dd70 -r bfb419c66ae9 src/hotspot/share/gc/z/zVirtualMemory.hpp --- a/src/hotspot/share/gc/z/zVirtualMemory.hpp Mon Oct 28 11:26:00 2019 +0100 +++ b/src/hotspot/share/gc/z/zVirtualMemory.hpp Mon Oct 28 11:26:53 2019 +0100 @@ -50,6 +50,8 @@ ZMemoryManager _manager; bool _initialized; + void initialize_os(); + bool reserve_contiguous_platform(uintptr_t start, size_t size); bool reserve_contiguous(size_t size); size_t reserve_discontiguous(uintptr_t start, size_t size, size_t min_range);