diff options
author | Austin Clements <austin@google.com> | 2017-12-04 10:43:11 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2018-02-15 21:12:12 +0000 |
commit | 41e6abdc61dd23ede4d3509aebf7b5a638f53712 (patch) | |
tree | 1b3d2b040bc1a97f159af33faf14d410dcbcbb42 /src/runtime/race.go | |
parent | b1d94c118fd163381537a22be4913742103baece (diff) | |
download | go-41e6abdc61dd23ede4d3509aebf7b5a638f53712.tar.gz go-41e6abdc61dd23ede4d3509aebf7b5a638f53712.zip |
runtime: replace mlookup and findObject with heapBitsForObject
These functions all serve essentially the same purpose. mlookup is
used in only one place and findObject in only three. Use
heapBitsForObject instead, which is the most optimized implementation.
(This may seem slightly silly because none of these uses care about
the heap bits, but we're about to split up the functionality of
heapBitsForObject anyway. At that point, findObject will rise from the
ashes.)
Change-Id: I906468c972be095dd23cf2404a7d4434e802f250
Reviewed-on: https://go-review.googlesource.com/85877
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/race.go')
-rw-r--r-- | src/runtime/race.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/race.go b/src/runtime/race.go index 2f5713d30e..1d35d2b641 100644 --- a/src/runtime/race.go +++ b/src/runtime/race.go @@ -187,10 +187,10 @@ type symbolizeDataContext struct { } func raceSymbolizeData(ctx *symbolizeDataContext) { - if _, x, n := findObject(unsafe.Pointer(ctx.addr)); x != nil { + if base, _, span, _ := heapBitsForObject(ctx.addr, 0, 0); base != 0 { ctx.heap = 1 - ctx.start = uintptr(x) - ctx.size = n + ctx.start = base + ctx.size = span.elemsize ctx.res = 1 } } |