diff options
| author | Austin Clements <austin@google.com> | 2016-04-28 10:59:00 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2016-04-29 03:53:14 +0000 |
| commit | b7adc41fbacac446c1daf0cb282cb2a921d4a15b (patch) | |
| tree | 119544779047b45d98afae79361295a2f0608c11 /src/runtime/stack.go | |
| parent | 2e8b74b69574e969b5565e69cb54d39064b2dba1 (diff) | |
| download | go-b7adc41fbacac446c1daf0cb282cb2a921d4a15b.tar.xz | |
[dev.garbage] runtime: use s.base() everywhere it makes sense
Currently we have lots of (s.start << _PageShift) and variants. We now
have an s.base() function that returns this. It's faster and more
readable, so use it.
Change-Id: I888060a9dae15ea75ca8cc1c2b31c905e71b452b
Reviewed-on: https://go-review.googlesource.com/22559
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/stack.go')
| -rw-r--r-- | src/runtime/stack.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go index ac4efc114b..f68c513fd6 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -198,7 +198,7 @@ func stackpoolalloc(order uint8) gclinkptr { throw("bad stackfreelist") } for i := uintptr(0); i < _StackCacheSize; i += _FixedStack << order { - x := gclinkptr(uintptr(s.start)<<_PageShift + i) + x := gclinkptr(s.base() + i) x.ptr().next = s.stackfreelist s.stackfreelist = x } @@ -391,7 +391,7 @@ func stackalloc(n uint32) (stack, []stkbar) { throw("out of memory") } } - v = unsafe.Pointer(s.start << _PageShift) + v = unsafe.Pointer(s.base()) } if raceenabled { @@ -456,7 +456,7 @@ func stackfree(stk stack, n uintptr) { } else { s := mheap_.lookup(v) if s.state != _MSpanStack { - println(hex(s.start<<_PageShift), v) + println(hex(s.base()), v) throw("bad span state") } if gcphase == _GCoff { |
