diff options
| author | Russ Cox <rsc@golang.org> | 2015-05-11 12:03:30 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-05-11 16:08:57 +0000 |
| commit | 363fd1dd1b810dd099f6aec1f110141fd8efb301 (patch) | |
| tree | e965b0055abed714ebdb6d3e471b4e764d13c5ae /src | |
| parent | fc595b78d216e9470afce5d99c002b4bf5760c2c (diff) | |
| download | go-363fd1dd1b810dd099f6aec1f110141fd8efb301.tar.xz | |
runtime: move a few atomic fields up
Moving them up makes them properly aligned on 32-bit systems.
There are some odd fields above them right now
(like fixalloc and mutex maybe).
Change-Id: I57851a5bbb2e7cc339712f004f99bb6c0cce0ca5
Reviewed-on: https://go-review.googlesource.com/9889
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/runtime/mheap.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 48e391648b..a610da2e47 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -28,6 +28,15 @@ type mheap struct { spans **mspan spans_mapped uintptr + // Proportional sweep + pagesSwept uint64 // pages swept this cycle; updated atomically + sweepPagesPerByte float64 // proportional sweep ratio; written with lock, read without + + // Malloc stats. + largefree uint64 // bytes freed for large objects (>maxsmallsize) + nlargefree uint64 // number of frees for large objects (>maxsmallsize) + nsmallfree [_NumSizeClasses]uint64 // number of frees for small objects (<=maxsmallsize) + // range of addresses we might see in the heap bitmap uintptr bitmap_mapped uintptr @@ -50,15 +59,6 @@ type mheap struct { specialfinalizeralloc fixalloc // allocator for specialfinalizer* specialprofilealloc fixalloc // allocator for specialprofile* speciallock mutex // lock for sepcial record allocators. - - // Proportional sweep - pagesSwept uint64 // pages swept this cycle; updated atomically - sweepPagesPerByte float64 // proportional sweep ratio; written with lock, read without - - // Malloc stats. - largefree uint64 // bytes freed for large objects (>maxsmallsize) - nlargefree uint64 // number of frees for large objects (>maxsmallsize) - nsmallfree [_NumSizeClasses]uint64 // number of frees for small objects (<=maxsmallsize) } var mheap_ mheap |
