mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: top align tinyallocs in race mode
Top align allocations in tinyalloc buckets when in race mode. This will make checkptr checks more reliable, because any code that modifies a pointer past the end of the object will trigger a checkptr error. No test, because we need -race for this to actually kick in. We could add it to the race detector tests, but the race detector tests are all geared towards race detector reports, not checkptr reports. Mucking with parsing reports is more than a test is worth. Fixes #38872 Change-Id: Ie56f0fbd1a9385539f6631fd1ac40c3de5600154 Reviewed-on: https://go-review.googlesource.com/c/go/+/315029 Trust: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
32dbaac572
commit
2c05ba4ae0
3 changed files with 26 additions and 1 deletions
|
|
@ -1267,3 +1267,5 @@ func GCTestIsReachable(ptrs ...unsafe.Pointer) (mask uint64) {
|
|||
func GCTestPointerClass(p unsafe.Pointer) string {
|
||||
return gcTestPointerClass(p)
|
||||
}
|
||||
|
||||
const Raceenabled = raceenabled
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue