Skip to content

Commit

Permalink
8214946: G1: Initialize all class members on construction
Browse files Browse the repository at this point in the history
Reviewed-by: kbarrett, tschatzl
  • Loading branch information
lkorinth committed Dec 17, 2018
1 parent 945e940 commit 811c84b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/g1/dirtyCardQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
PtrQueueSet(notify_when_complete),
_shared_dirty_card_queue(this, true /* permanent */),
_free_ids(NULL),
_processed_buffers_mut(0), _processed_buffers_rs_thread(0)
_processed_buffers_mut(0),
_processed_buffers_rs_thread(0),
_cur_par_buffer_node(NULL)
{
_all_active = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1CardCounts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
}

G1CardCounts::G1CardCounts(G1CollectedHeap *g1h):
_listener(), _g1h(g1h), _card_counts(NULL), _reserved_max_card_num(0) {
_listener(), _g1h(g1h), _ct(NULL), _card_counts(NULL), _reserved_max_card_num(0), _ct_bot(NULL) {
_listener.set_cardcounts(this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4287,7 +4287,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure {
public:

G1FreeHumongousRegionClosure(FreeRegionList* free_region_list) :
_free_region_list(free_region_list), _humongous_objects_reclaimed(0), _humongous_regions_reclaimed(0), _freed_bytes(0) {
_free_region_list(free_region_list), _proxy_set(NULL), _humongous_objects_reclaimed(0), _humongous_regions_reclaimed(0), _freed_bytes(0) {
}

virtual bool do_heap_region(HeapRegion* r) {
Expand Down
6 changes: 1 addition & 5 deletions src/hotspot/share/gc/g1/g1HeapVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,6 @@ void G1HeapVerifier::verify_ready_for_archiving() {
}

class VerifyArchivePointerRegionClosure: public HeapRegionClosure {
private:
G1CollectedHeap* _g1h;
public:
VerifyArchivePointerRegionClosure(G1CollectedHeap* g1h) { }
virtual bool do_heap_region(HeapRegion* r) {
if (r->is_archive()) {
VerifyObjectInArchiveRegionClosure verify_oop_pointers(r, false);
Expand All @@ -352,7 +348,7 @@ class VerifyArchivePointerRegionClosure: public HeapRegionClosure {

void G1HeapVerifier::verify_archive_regions() {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
VerifyArchivePointerRegionClosure cl(NULL);
VerifyArchivePointerRegionClosure cl;
g1h->heap_region_iterate(&cl);
}

Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -40,7 +40,8 @@ G1YoungRemSetSamplingThread::G1YoungRemSetSamplingThread() :
"G1YoungRemSetSamplingThread monitor",
true,
Monitor::_safepoint_check_never),
_last_periodic_gc_attempt_s(os::elapsedTime()) {
_last_periodic_gc_attempt_s(os::elapsedTime()),
_vtime_accum(0) {
set_name("G1 Young RemSet Sampling");
create_and_start();
}
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/g1/heapRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,10 @@ void G1ContiguousSpace::object_iterate(ObjectClosure* blk) {
}

G1ContiguousSpace::G1ContiguousSpace(G1BlockOffsetTable* bot) :
_top(NULL),
_bot_part(bot, this),
_par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true)
_par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true),
_pre_dummy_top(NULL)
{
}

Expand Down

0 comments on commit 811c84b

Please sign in to comment.