Commit 259d6099 authored by Aliaksandr Valialkin's avatar Aliaksandr Valialkin Committed by Ian Lance Taylor

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/41550Reviewed-by: 's avatarAustin Clements <austin@google.com>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent c433c374
......@@ -121,7 +121,7 @@ type mheap struct {
// gets its own cache line.
central [_NumSizeClasses]struct {
mcentral mcentral
pad [sys.CacheLineSize]byte
pad [sys.CacheLineSize - unsafe.Sizeof(mcentral{})%sys.CacheLineSize]byte
}
spanalloc fixalloc // allocator for span*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment