comparison src/share/vm/gc_implementation/g1/sparsePRT.cpp @ 6010:720b6a76dd9d

7157073: G1: type change size_t -> uint for region counts / indexes Summary: Change the type of fields / variables / etc. that represent region counts and indeces from size_t to uint. Reviewed-by: iveresov, brutisso, jmasa, jwilhelm
author tonyp
date Wed, 18 Apr 2012 07:21:15 -0400
parents c3f1170908be
children d2a62e0f25eb
comparison
equal deleted inserted replaced
6009:dde53abda3d6 6010:720b6a76dd9d
1 /* 1 /*
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
479 return sizeof(this) + _next->mem_size(); 479 return sizeof(this) + _next->mem_size();
480 } 480 }
481 481
482 bool SparsePRT::add_card(RegionIdx_t region_id, CardIdx_t card_index) { 482 bool SparsePRT::add_card(RegionIdx_t region_id, CardIdx_t card_index) {
483 #if SPARSE_PRT_VERBOSE 483 #if SPARSE_PRT_VERBOSE
484 gclog_or_tty->print_cr(" Adding card %d from region %d to region " 484 gclog_or_tty->print_cr(" Adding card %d from region %d to region %u sparse.",
485 SIZE_FORMAT" sparse.",
486 card_index, region_id, _hr->hrs_index()); 485 card_index, region_id, _hr->hrs_index());
487 #endif 486 #endif
488 if (_next->occupied_entries() * 2 > _next->capacity()) { 487 if (_next->occupied_entries() * 2 > _next->capacity()) {
489 expand(); 488 expand();
490 } 489 }
532 void SparsePRT::expand() { 531 void SparsePRT::expand() {
533 RSHashTable* last = _next; 532 RSHashTable* last = _next;
534 _next = new RSHashTable(last->capacity() * 2); 533 _next = new RSHashTable(last->capacity() * 2);
535 534
536 #if SPARSE_PRT_VERBOSE 535 #if SPARSE_PRT_VERBOSE
537 gclog_or_tty->print_cr(" Expanded sparse table for "SIZE_FORMAT" to %d.", 536 gclog_or_tty->print_cr(" Expanded sparse table for %u to %d.",
538 _hr->hrs_index(), _next->capacity()); 537 _hr->hrs_index(), _next->capacity());
539 #endif 538 #endif
540 for (size_t i = 0; i < last->capacity(); i++) { 539 for (size_t i = 0; i < last->capacity(); i++) {
541 SparsePRTEntry* e = last->entry((int)i); 540 SparsePRTEntry* e = last->entry((int)i);
542 if (e->valid_entry()) { 541 if (e->valid_entry()) {