Mercurial > hg > graal-compiler
diff src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp @ 17727:cfd4aac53239
8030177: G1: Enable TLAB resizing
Reviewed-by: tschatzl, stefank, jmasa
author | brutisso |
---|---|
date | Mon, 27 Jan 2014 13:14:53 +0100 |
parents | 55fb97c4c58d |
children | 78bbf4d43a14 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Thu Jan 23 12:08:28 2014 +0100 +++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Mon Jan 27 13:14:53 2014 +0100 @@ -173,6 +173,26 @@ return lgrp_spaces()->at(i)->space()->capacity_in_bytes(); } +size_t MutableNUMASpace::tlab_used(Thread *thr) const { + // Please see the comments for tlab_capacity(). + guarantee(thr != NULL, "No thread"); + int lgrp_id = thr->lgrp_id(); + if (lgrp_id == -1) { + if (lgrp_spaces()->length() > 0) { + return (used_in_bytes()) / lgrp_spaces()->length(); + } else { + assert(false, "There should be at least one locality group"); + return 0; + } + } + int i = lgrp_spaces()->find(&lgrp_id, LGRPSpace::equals); + if (i == -1) { + return 0; + } + return lgrp_spaces()->at(i)->space()->used_in_bytes(); +} + + size_t MutableNUMASpace::unsafe_max_tlab_alloc(Thread *thr) const { // Please see the comments for tlab_capacity(). guarantee(thr != NULL, "No thread");