File tree 2 files changed +23
-17
lines changed
2 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,27 @@ import (
46
46
"unsafe"
47
47
)
48
48
49
+ // heapArenaPtrScalar contains the per-heapArena pointer/scalar metadata for the GC.
50
+ type heapArenaPtrScalar struct {
51
+ // bitmap stores the pointer/scalar bitmap for the words in
52
+ // this arena. See mbitmap.go for a description.
53
+ // This array uses 1 bit per word of heap, or 1.6% of the heap size (for 64-bit).
54
+ bitmap [heapArenaBitmapWords ]uintptr
55
+
56
+ // If the ith bit of noMorePtrs is true, then there are no more
57
+ // pointers for the object containing the word described by the
58
+ // high bit of bitmap[i].
59
+ // In that case, bitmap[i+1], ... must be zero until the start
60
+ // of the next object.
61
+ // We never operate on these entries using bit-parallel techniques,
62
+ // so it is ok if they are small. Also, they can't be bigger than
63
+ // uint16 because at that size a single noMorePtrs entry
64
+ // represents 8K of memory, the minimum size of a span. Any larger
65
+ // and we'd have to worry about concurrent updates.
66
+ // This array uses 1 bit per word of bitmap, or .024% of the heap size (for 64-bit).
67
+ noMorePtrs [heapArenaBitmapWords / 8 ]uint8
68
+ }
69
+
49
70
// addb returns the byte pointer p+n.
50
71
//
51
72
//go:nowritebarrier
Original file line number Diff line number Diff line change @@ -239,23 +239,8 @@ var mheap_ mheap
239
239
type heapArena struct {
240
240
_ sys.NotInHeap
241
241
242
- // bitmap stores the pointer/scalar bitmap for the words in
243
- // this arena. See mbitmap.go for a description.
244
- // This array uses 1 bit per word of heap, or 1.6% of the heap size (for 64-bit).
245
- bitmap [heapArenaBitmapWords ]uintptr
246
-
247
- // If the ith bit of noMorePtrs is true, then there are no more
248
- // pointers for the object containing the word described by the
249
- // high bit of bitmap[i].
250
- // In that case, bitmap[i+1], ... must be zero until the start
251
- // of the next object.
252
- // We never operate on these entries using bit-parallel techniques,
253
- // so it is ok if they are small. Also, they can't be bigger than
254
- // uint16 because at that size a single noMorePtrs entry
255
- // represents 8K of memory, the minimum size of a span. Any larger
256
- // and we'd have to worry about concurrent updates.
257
- // This array uses 1 bit per word of bitmap, or .024% of the heap size (for 64-bit).
258
- noMorePtrs [heapArenaBitmapWords / 8 ]uint8
242
+ // heapArenaPtrScalar contains pointer/scalar data about the heap for this heap arena.
243
+ heapArenaPtrScalar
259
244
260
245
// spans maps from virtual address page ID within this arena to *mspan.
261
246
// For allocated spans, their pages map to the span itself.
You can’t perform that action at this time.
0 commit comments