ogle/probe: add a sanity check for heapStart and heapUsed.
LGTM=r
R=r
https://golang.org/cl/62030043
diff --git a/probe/addr_test.go b/probe/addr_test.go
index f35a9f0..eca60c1 100644
--- a/probe/addr_test.go
+++ b/probe/addr_test.go
@@ -24,6 +24,13 @@
}
}
+func TestHeapRange(t *testing.T) {
+ p := addr(new(int)) // On the heap.
+ if p < heapStart() || heapUsed() <= p {
+ t.Fatalf("%#x is not in [%#x, %#x)", p, heapStart(), heapUsed())
+ }
+}
+
func TestGoodReadAddresses(t *testing.T) {
addrs := []uintptr{
base(),