aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2019-10-24 09:00:27 -0400
committerAustin Clements <austin@google.com>2019-10-31 17:09:48 +0000
commita9b37ae02604e03d2356b6143679d2a71bdd32a7 (patch)
treec60a24a4d12ae59fd6b1b564f8c0d7bd0037668f /src/runtime/stack.go
parentd5caea771e917e13c4d05a6d7c5a009bf719d299 (diff)
downloadgo-a9b37ae02604e03d2356b6143679d2a71bdd32a7.tar.xz
runtime: fully initialize span in alloc_m
Currently, several important fields of a heap span are set by heapBits.initSpan, which happens after the span has already been published and returned from the locked region of alloc_m. In particular, allocBits is set very late, which makes mspan.isFree unsafe even if you were to lock the heap because it tries to access allocBits. This CL fixes this by populating these fields in alloc_m. The next CL builds on this to only publish the span once it is fully initialized. Together, they'll make it safe to check allocBits even if there is a race with alloc_m. For #10958, #24543, but a good fix in general. Change-Id: I7fde90023af0f497e826b637efa4d19c32840c08 Reviewed-on: https://go-review.googlesource.com/c/go/+/203285 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/stack.go')
0 files changed, 0 insertions, 0 deletions