mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: align mcentral by cache line size
This may improve perormance during concurrent access to mheap.central array from multiple CPU cores. Change-Id: I8f48dd2e72aa62e9c32de07ae60fe552d8642782 Reviewed-on: https://go-review.googlesource.com/41550 Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
c433c374b5
commit
259d60995d
1 changed files with 1 additions and 1 deletions
|
|
@ -121,7 +121,7 @@ type mheap struct {
|
||||||
// gets its own cache line.
|
// gets its own cache line.
|
||||||
central [_NumSizeClasses]struct {
|
central [_NumSizeClasses]struct {
|
||||||
mcentral mcentral
|
mcentral mcentral
|
||||||
pad [sys.CacheLineSize]byte
|
pad [sys.CacheLineSize - unsafe.Sizeof(mcentral{})%sys.CacheLineSize]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
spanalloc fixalloc // allocator for span*
|
spanalloc fixalloc // allocator for span*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue