]> Cypherpunks repositories - gostls13.git/commit
runtime: add GC testing helpers for regabi signature fuzzer
authorAustin Clements <austin@google.com>
Wed, 24 Mar 2021 14:45:20 +0000 (10:45 -0400)
committerAustin Clements <austin@google.com>
Mon, 29 Mar 2021 21:50:16 +0000 (21:50 +0000)
commit4e1bf8ed3840632b4781d3c4abb4704dca468dd4
treeb1137dc58e46403a9454d0acd6f8e5f1078459fd
parent1ef114d12c39e8467d3e905d0a050bd7ce03123a
runtime: add GC testing helpers for regabi signature fuzzer

This CL adds a set of helper functions for testing GC interactions.
These are intended for use in the regabi signature fuzzer, but are
generally useful for GC tests, so we make them generally available to
runtime tests.

These provide:

1. An easy way to force stack movement, for testing stack copying.

2. A simple and robust way to check the reachability of a set of
pointers.

3. A way to check what general category of memory a pointer points to,
mostly so tests can make sure they're testing what they mean to.

For #40724, but generally useful.

Change-Id: I15d33ccb3f5a792c0472a19c2cc9a8b4a9356a66
Reviewed-on: https://go-review.googlesource.com/c/go/+/305330
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/runtime/export_test.go
src/runtime/gc_test.go
src/runtime/mgc.go
src/runtime/mgcsweep.go
src/runtime/mheap.go