8145673: G1RemSetSummary.hpp uses FREE_C_HEAP_ARRAY

Move destructor work into cpp file

Reviewed-by: mgerdin, stefank
This commit is contained in:
Thomas Schatzl 2015-12-18 14:27:51 +01:00
parent 7806389bef
commit 92c56ccb9c
2 changed files with 21 additions and 16 deletions

View File

@ -30,6 +30,7 @@
#include "gc/g1/g1RemSetSummary.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/g1/heapRegionRemSet.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/thread.inline.hpp"
class GetRSThreadVTimeClosure : public ThreadClosure {
@ -89,6 +90,23 @@ void G1RemSetSummary::initialize(G1RemSet* remset) {
update();
}
G1RemSetSummary::G1RemSetSummary() :
_remset(NULL),
_num_refined_cards(0),
_num_processed_buf_mutator(0),
_num_processed_buf_rs_threads(0),
_num_coarsenings(0),
_rs_threads_vtimes(NULL),
_num_vtimes(0),
_sampling_thread_vtime(0.0f) {
}
G1RemSetSummary::~G1RemSetSummary() {
if (_rs_threads_vtimes) {
FREE_C_HEAP_ARRAY(double, _rs_threads_vtimes);
}
}
void G1RemSetSummary::set(G1RemSetSummary* other) {
assert(other != NULL, "just checking");
assert(remset() == other->remset(), "just checking");

View File

@ -25,6 +25,7 @@
#ifndef SHARE_VM_GC_G1_G1REMSETSUMMARY_HPP
#define SHARE_VM_GC_G1_G1REMSETSUMMARY_HPP
#include "utilities/globalDefinitions.hpp"
#include "utilities/ostream.hpp"
class G1RemSet;
@ -57,26 +58,12 @@ private:
_sampling_thread_vtime = value;
}
void free_and_null() {
if (_rs_threads_vtimes) {
FREE_C_HEAP_ARRAY(double, _rs_threads_vtimes);
_rs_threads_vtimes = NULL;
_num_vtimes = 0;
}
}
// update this summary with current data from various places
void update();
public:
G1RemSetSummary() : _remset(NULL), _num_refined_cards(0),
_num_processed_buf_mutator(0), _num_processed_buf_rs_threads(0), _num_coarsenings(0),
_rs_threads_vtimes(NULL), _num_vtimes(0), _sampling_thread_vtime(0.0f) {
}
~G1RemSetSummary() {
free_and_null();
}
G1RemSetSummary();
~G1RemSetSummary();
// set the counters in this summary to the values of the others
void set(G1RemSetSummary* other);