@@ -602,8 +602,8 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
602
602
// efficient; allocfreetrace has massive overhead.
603
603
mbits := s .markBitsForBase ()
604
604
abits := s .allocBitsForIndex (0 )
605
- for i := uintptr (0 ); i < s .nelems ; i ++ {
606
- if ! mbits .isMarked () && (abits .index < s .freeindex || abits .isMarked ()) {
605
+ for i := uintptr (0 ); i < uintptr ( s .nelems ) ; i ++ {
606
+ if ! mbits .isMarked () && (abits .index < uintptr ( s .freeindex ) || abits .isMarked ()) {
607
607
x := s .base () + i * s .elemsize
608
608
if debug .allocfreetrace != 0 {
609
609
tracefree (unsafe .Pointer (x ), size )
@@ -634,12 +634,12 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
634
634
//
635
635
// Check the first bitmap byte, where we have to be
636
636
// careful with freeindex.
637
- obj := s .freeindex
637
+ obj := uintptr ( s .freeindex )
638
638
if (* s .gcmarkBits .bytep (obj / 8 )&^* s .allocBits .bytep (obj / 8 ))>> (obj % 8 ) != 0 {
639
639
s .reportZombies ()
640
640
}
641
641
// Check remaining bytes.
642
- for i := obj / 8 + 1 ; i < divRoundUp (s .nelems , 8 ); i ++ {
642
+ for i := obj / 8 + 1 ; i < divRoundUp (uintptr ( s .nelems ) , 8 ); i ++ {
643
643
if * s .gcmarkBits .bytep (i )&^* s .allocBits .bytep (i ) != 0 {
644
644
s .reportZombies ()
645
645
}
@@ -666,7 +666,7 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
666
666
// gcmarkBits becomes the allocBits.
667
667
// get a fresh cleared gcmarkBits in preparation for next GC
668
668
s .allocBits = s .gcmarkBits
669
- s .gcmarkBits = newMarkBits (s .nelems )
669
+ s .gcmarkBits = newMarkBits (uintptr ( s .nelems ) )
670
670
671
671
// refresh pinnerBits if they exists
672
672
if s .pinnerBits != nil {
@@ -760,7 +760,7 @@ func (sl *sweepLocked) sweep(preserve bool) bool {
760
760
return true
761
761
}
762
762
// Return span back to the right mcentral list.
763
- if uintptr ( nalloc ) == s .nelems {
763
+ if nalloc == s .nelems {
764
764
mheap_ .central [spc ].mcentral .fullSwept (sweepgen ).push (s )
765
765
} else {
766
766
mheap_ .central [spc ].mcentral .partialSwept (sweepgen ).push (s )
@@ -829,10 +829,10 @@ func (s *mspan) reportZombies() {
829
829
print ("runtime: marked free object in span " , s , ", elemsize=" , s .elemsize , " freeindex=" , s .freeindex , " (bad use of unsafe.Pointer? try -d=checkptr)\n " )
830
830
mbits := s .markBitsForBase ()
831
831
abits := s .allocBitsForIndex (0 )
832
- for i := uintptr (0 ); i < s .nelems ; i ++ {
832
+ for i := uintptr (0 ); i < uintptr ( s .nelems ) ; i ++ {
833
833
addr := s .base () + i * s .elemsize
834
834
print (hex (addr ))
835
- alloc := i < s .freeindex || abits .isMarked ()
835
+ alloc := i < uintptr ( s .freeindex ) || abits .isMarked ()
836
836
if alloc {
837
837
print (" alloc" )
838
838
} else {
0 commit comments