mirror of
https://github.com/golang/go
synced 2024-11-26 03:47:57 -07:00
runtime: replace union in MHeap with a struct
Unions break precise GC. Update #5193. R=golang-dev, iant CC=golang-dev https://golang.org/cl/8368044
This commit is contained in:
parent
54340bf56f
commit
cfe336770b
@ -416,10 +416,10 @@ struct MHeap
|
||||
byte *arena_end;
|
||||
|
||||
// central free lists for small size classes.
|
||||
// the union makes sure that the MCentrals are
|
||||
// the padding makes sure that the MCentrals are
|
||||
// spaced CacheLineSize bytes apart, so that each MCentral.Lock
|
||||
// gets its own cache line.
|
||||
union {
|
||||
struct {
|
||||
MCentral;
|
||||
byte pad[CacheLineSize];
|
||||
} central[NumSizeClasses];
|
||||
|
@ -61,6 +61,8 @@ struct Bucket
|
||||
Bucket *next; // next in hash list
|
||||
Bucket *allnext; // next in list of all mbuckets/bbuckets
|
||||
int32 typ;
|
||||
// Generally unions can break precise GC,
|
||||
// this one is fine because it does not contain pointers.
|
||||
union
|
||||
{
|
||||
struct // typ == MProf
|
||||
|
Loading…
Reference in New Issue
Block a user