aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mcentral.go
diff options
context:
space:
mode:
authorMichael Knyszek <mknyszek@google.com>2022-11-11 18:34:18 +0000
committerCherry Mui <cherryyz@google.com>2022-11-14 22:09:16 +0000
commit2b59307ac21135ab8db58e08fb98211fbedbb10d (patch)
tree6734f48f3c07070439dcfc35aac838dab9868a5f /src/runtime/mcentral.go
parent998c11d2187d8afaa315f58f29f80b6882d2701c (diff)
downloadgo-2b59307ac21135ab8db58e08fb98211fbedbb10d.tar.xz
Revert "runtime: delay incrementing freeindex in malloc"
This reverts commit bed2b7cf41471e1521af5a83ae28bd643eb3e038. Reason for revert: I clicked submit by accident on the wrong CL. Change-Id: Iddf128cb62f289d472510eb30466e515068271b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/449501 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/mcentral.go')
-rw-r--r--src/runtime/mcentral.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/mcentral.go b/src/runtime/mcentral.go
index 6621af5f78..3382c54e7f 100644
--- a/src/runtime/mcentral.go
+++ b/src/runtime/mcentral.go
@@ -146,6 +146,7 @@ func (c *mcentral) cacheSpan() *mspan {
// Check if there's any free space.
freeIndex := s.nextFreeIndex()
if freeIndex != s.nelems {
+ s.freeindex = freeIndex
sweep.active.end(sl)
goto havespan
}