src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp

changeset 3900
d2a62e0f25eb
parent 2716
c84ee870e0b9
child 3924
3a431b605145
     1.1 --- a/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp	Wed Jun 27 15:23:36 2012 +0200
     1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp	Thu Jun 28 17:03:16 2012 -0400
     1.3 @@ -79,7 +79,7 @@
     1.4    _n_threads = _n_worker_threads + 1;
     1.5    reset_threshold_step();
     1.6  
     1.7 -  _threads = NEW_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _n_threads);
     1.8 +  _threads = NEW_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _n_threads, mtGC);
     1.9    int worker_id_offset = (int)DirtyCardQueueSet::num_par_ids();
    1.10    ConcurrentG1RefineThread *next = NULL;
    1.11    for (int i = _n_threads - 1; i >= 0; i--) {
    1.12 @@ -157,7 +157,7 @@
    1.13      _def_use_cache = true;
    1.14      _use_cache = true;
    1.15      _hot_cache_size = (1 << G1ConcRSLogCacheSize);
    1.16 -    _hot_cache = NEW_C_HEAP_ARRAY(jbyte*, _hot_cache_size);
    1.17 +    _hot_cache = NEW_C_HEAP_ARRAY(jbyte*, _hot_cache_size, mtGC);
    1.18      _n_hot = 0;
    1.19      _hot_cache_idx = 0;
    1.20  
    1.21 @@ -191,18 +191,18 @@
    1.22      // Please see the comment in allocate_card_count_cache
    1.23      // for why we call os::malloc() and os::free() directly.
    1.24      assert(_card_counts != NULL, "Logic");
    1.25 -    os::free(_card_counts);
    1.26 +    os::free(_card_counts, mtGC);
    1.27      assert(_card_epochs != NULL, "Logic");
    1.28 -    os::free(_card_epochs);
    1.29 +    os::free(_card_epochs, mtGC);
    1.30  
    1.31      assert(_hot_cache != NULL, "Logic");
    1.32 -    FREE_C_HEAP_ARRAY(jbyte*, _hot_cache);
    1.33 +    FREE_C_HEAP_ARRAY(jbyte*, _hot_cache, mtGC);
    1.34    }
    1.35    if (_threads != NULL) {
    1.36      for (int i = 0; i < _n_threads; i++) {
    1.37        delete _threads[i];
    1.38      }
    1.39 -    FREE_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _threads);
    1.40 +    FREE_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _threads, mtGC);
    1.41    }
    1.42  }
    1.43  
    1.44 @@ -436,17 +436,17 @@
    1.45    size_t counts_size = n * sizeof(CardCountCacheEntry);
    1.46    size_t epochs_size = n * sizeof(CardEpochCacheEntry);
    1.47  
    1.48 -  *counts = (CardCountCacheEntry*) os::malloc(counts_size);
    1.49 +  *counts = (CardCountCacheEntry*) os::malloc(counts_size, mtGC);
    1.50    if (*counts == NULL) {
    1.51      // allocation was unsuccessful
    1.52      return false;
    1.53    }
    1.54  
    1.55 -  *epochs = (CardEpochCacheEntry*) os::malloc(epochs_size);
    1.56 +  *epochs = (CardEpochCacheEntry*) os::malloc(epochs_size, mtGC);
    1.57    if (*epochs == NULL) {
    1.58      // allocation was unsuccessful - free counts array
    1.59      assert(*counts != NULL, "must be");
    1.60 -    os::free(*counts);
    1.61 +    os::free(*counts, mtGC);
    1.62      *counts = NULL;
    1.63      return false;
    1.64    }
    1.65 @@ -479,8 +479,8 @@
    1.66          // Allocation was successful.
    1.67          // We can just free the old arrays; we're
    1.68          // not interested in preserving the contents
    1.69 -        if (_card_counts != NULL) os::free(_card_counts);
    1.70 -        if (_card_epochs != NULL) os::free(_card_epochs);
    1.71 +        if (_card_counts != NULL) os::free(_card_counts, mtGC);
    1.72 +        if (_card_epochs != NULL) os::free(_card_epochs, mtGC);
    1.73  
    1.74          // Cache the size of the arrays and the index that got us there.
    1.75          _n_card_counts = cache_size;

mercurial