8209126: ZGC: ZMarkStackAllocator::is_initialized() never called

Reviewed-by: eosterlund, tschatzl
This commit is contained in:
Per Lidén 2018-08-09 11:24:30 +02:00
parent 6c7f0f0218
commit abb1e458eb
3 changed files with 8 additions and 2 deletions

View File

@ -96,7 +96,7 @@ size_t ZHeap::heap_max_reserve_size() const {
}
bool ZHeap::is_initialized() const {
return _page_allocator.is_initialized();
return _page_allocator.is_initialized() && _mark.is_initialized();
}
size_t ZHeap::min_capacity() const {

View File

@ -70,6 +70,10 @@ ZMark::ZMark(ZWorkers* workers, ZPageTable* pagetable) :
_ncontinue(0),
_nworkers(0) {}
bool ZMark::is_initialized() const {
return _allocator.is_initialized();
}
size_t ZMark::calculate_nstripes(uint nworkers) const {
// Calculate the number of stripes from the number of workers we use,
// where the number of stripes must be a power of two and we want to

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2018, 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
@ -102,6 +102,8 @@ private:
public:
ZMark(ZWorkers* workers, ZPageTable* pagetable);
bool is_initialized() const;
template <bool finalizable, bool publish> void mark_object(uintptr_t addr);
void start();