This method indicates whether a type contains any *heap* pointers, not
just whether it contains any pointers. Rename the method to make this
clear.
Change-Id: Ifff143e2f02a820444ac26b84250495c0098cb33
Reviewed-on: https://go-review.googlesource.com/67690
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
if !ok {
v.Fatalf("store aux is not a type: %s", v.LongString())
}
- if !t.HasPointer() {
+ if !t.HasHeapPointer() {
return false
}
if IsStackAddr(v.Args[0]) {
return true
}
-// HasPointer returns whether t contains heap pointer.
+// HasHeapPointer returns whether t contains a heap pointer.
// This is used for write barrier insertion, so we ignore
// pointers to go:notinheap types.
-func (t *Type) HasPointer() bool {
+func (t *Type) HasHeapPointer() bool {
if t.IsPtr() && t.Elem().NotInHeap() {
return false
}