@@ -54,17 +54,17 @@ MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment),
54
54
#endif // LINUX
55
55
56
56
size_t lgrp_limit = os::numa_get_groups_num ();
57
- int *lgrp_ids = NEW_C_HEAP_ARRAY (int , lgrp_limit, mtGC);
58
- int lgrp_num = ( int ) os::numa_get_leaf_groups (lgrp_ids, lgrp_limit);
57
+ uint *lgrp_ids = NEW_C_HEAP_ARRAY (uint , lgrp_limit, mtGC);
58
+ size_t lgrp_num = os::numa_get_leaf_groups (reinterpret_cast < int *>( lgrp_ids) , lgrp_limit);
59
59
assert (lgrp_num > 0 , " There should be at least one locality group" );
60
60
61
- lgrp_spaces ()->reserve (lgrp_num);
61
+ lgrp_spaces ()->reserve (checked_cast< int >( lgrp_num) );
62
62
// Add new spaces for the new nodes
63
- for (int i = 0 ; i < lgrp_num; i++) {
63
+ for (size_t i = 0 ; i < lgrp_num; i++) {
64
64
lgrp_spaces ()->append (new LGRPSpace (lgrp_ids[i], alignment));
65
65
}
66
66
67
- FREE_C_HEAP_ARRAY (int , lgrp_ids);
67
+ FREE_C_HEAP_ARRAY (uint , lgrp_ids);
68
68
}
69
69
70
70
MutableNUMASpace::~MutableNUMASpace () {
@@ -207,7 +207,7 @@ size_t MutableNUMASpace::unsafe_max_tlab_alloc(Thread *thr) const {
207
207
}
208
208
209
209
// Bias region towards the first-touching lgrp. Set the right page sizes.
210
- void MutableNUMASpace::bias_region (MemRegion mr, int lgrp_id) {
210
+ void MutableNUMASpace::bias_region (MemRegion mr, uint lgrp_id) {
211
211
HeapWord *start = align_up (mr.start (), page_size ());
212
212
HeapWord *end = align_down (mr.end (), page_size ());
213
213
if (end > start) {
@@ -224,7 +224,7 @@ void MutableNUMASpace::bias_region(MemRegion mr, int lgrp_id) {
224
224
// size if not using large pages or else this function does nothing.
225
225
os::free_memory ((char *)aligned_region.start (), aligned_region.byte_size (), os_align);
226
226
// And make them local/first-touch biased.
227
- os::numa_make_local ((char *)aligned_region.start (), aligned_region.byte_size (), lgrp_id);
227
+ os::numa_make_local ((char *)aligned_region.start (), aligned_region.byte_size (), checked_cast< int >( lgrp_id) );
228
228
}
229
229
}
230
230
@@ -623,7 +623,7 @@ void MutableNUMASpace::print_short_on(outputStream* st) const {
623
623
MutableSpace::print_short_on (st);
624
624
st->print (" (" );
625
625
for (int i = 0 ; i < lgrp_spaces ()->length (); i++) {
626
- st->print (" lgrp %d : " , lgrp_spaces ()->at (i)->lgrp_id ());
626
+ st->print (" lgrp %u : " , lgrp_spaces ()->at (i)->lgrp_id ());
627
627
lgrp_spaces ()->at (i)->space ()->print_short_on (st);
628
628
if (i < lgrp_spaces ()->length () - 1 ) {
629
629
st->print (" , " );
@@ -636,7 +636,7 @@ void MutableNUMASpace::print_on(outputStream* st) const {
636
636
MutableSpace::print_on (st);
637
637
for (int i = 0 ; i < lgrp_spaces ()->length (); i++) {
638
638
LGRPSpace *ls = lgrp_spaces ()->at (i);
639
- st->print (" lgrp %d " , ls->lgrp_id ());
639
+ st->print (" lgrp %u " , ls->lgrp_id ());
640
640
ls->space ()->print_on (st);
641
641
if (NUMAStats) {
642
642
for (int i = 0 ; i < lgrp_spaces ()->length (); i++) {
@@ -679,7 +679,7 @@ void MutableNUMASpace::LGRPSpace::accumulate_statistics(size_t page_size) {
679
679
for (size_t i = 0 ; i < npages; i++) {
680
680
if (lgrp_ids[i] < 0 ) {
681
681
space_stats ()->_uncommited_space += os::vm_page_size ();
682
- } else if (lgrp_ids[i] == lgrp_id ()) {
682
+ } else if (checked_cast< uint >( lgrp_ids[i]) == lgrp_id ()) {
683
683
space_stats ()->_local_space += os::vm_page_size ();
684
684
} else {
685
685
space_stats ()->_remote_space += os::vm_page_size ();
@@ -709,7 +709,7 @@ void MutableNUMASpace::LGRPSpace::scan_pages(size_t page_size, size_t page_count
709
709
710
710
os::page_info page_expected, page_found;
711
711
page_expected.size = page_size;
712
- page_expected.lgrp_id = lgrp_id ();
712
+ page_expected.lgrp_id = checked_cast< uint >( lgrp_id () );
713
713
714
714
char *s = scan_start;
715
715
while (s < scan_end) {
@@ -720,7 +720,7 @@ void MutableNUMASpace::LGRPSpace::scan_pages(size_t page_size, size_t page_count
720
720
if (e != scan_end) {
721
721
assert (e < scan_end, " e: " PTR_FORMAT " scan_end: " PTR_FORMAT, p2i (e), p2i (scan_end));
722
722
723
- if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id ())
723
+ if ((page_expected.size != page_size || checked_cast< uint >( page_expected.lgrp_id ) != lgrp_id ())
724
724
&& page_expected.size != 0 ) {
725
725
os::free_memory (s, pointer_delta (e, s, sizeof (char )), page_size);
726
726
}
0 commit comments