1 //go:build gc.conservative
2 3 // This implements the block-based heap as a fully conservative GC. No tracking
4 // of pointers is done, every word in an object is considered live if it looks
5 // like a pointer.
6 7 package runtime
8 9 import "unsafe"
10 11 // parseGCLayout stores the layout information passed to alloc into a gcLayout value.
12 // The conservative GC discards this information.
13 func parseGCLayout(layout unsafe.Pointer) gcLayout {
14 return gcLayout{}
15 }
16 17 // gcLayout tracks pointer locations in a heap object.
18 // The conservative GC treats all locations as potential pointers, so this doesn't need to store anything.
19 type gcLayout struct {
20 }
21 22 func (l gcLayout) pointerFree() bool {
23 // We don't know whether this object contains pointers, so conservatively
24 // return false.
25 return false
26 }
27 28 func (l gcLayout) scan(start, len uintptr) {
29 scanConservative(start, len)
30 }
31