diff options
author | Matthew Dempsky <mdempsky@google.com> | 2015-11-11 16:13:51 -0800 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2015-11-12 00:34:58 +0000 |
commit | c17c42e8a5232d7e56225caf9048cfa89f6923d0 (patch) | |
tree | 56397252fa1c17f3243e000fa497c97e207cde82 /src/runtime/mfixalloc.go | |
parent | 58db5fc94d6038aa0308fc36c25b551a751260c2 (diff) | |
download | go-c17c42e8a5232d7e56225caf9048cfa89f6923d0.tar.gz go-c17c42e8a5232d7e56225caf9048cfa89f6923d0.zip |
runtime: rewrite lots of foo_Bar(f, ...) into f.bar(...)
Applies to types fixAlloc, mCache, mCentral, mHeap, mSpan, and
mSpanList.
Two special cases:
1. mHeap_Scavenge() previously didn't take an *mheap parameter, so it
was specially handled in this CL.
2. mHeap_Free() would have collided with mheap's "free" field, so it's
been renamed to (*mheap).freeSpan to parallel its underlying
(*mheap).freeSpanLocked method.
Change-Id: I325938554cca432c166fe9d9d689af2bbd68de4b
Reviewed-on: https://go-review.googlesource.com/16221
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/mfixalloc.go')
-rw-r--r-- | src/runtime/mfixalloc.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/mfixalloc.go b/src/runtime/mfixalloc.go index 54d4a74453..8653a6a99f 100644 --- a/src/runtime/mfixalloc.go +++ b/src/runtime/mfixalloc.go @@ -40,7 +40,7 @@ type mlink struct { // Initialize f to allocate objects of the given size, // using the allocator to obtain chunks of memory. -func fixAlloc_Init(f *fixalloc, size uintptr, first func(arg, p unsafe.Pointer), arg unsafe.Pointer, stat *uint64) { +func (f *fixalloc) init(size uintptr, first func(arg, p unsafe.Pointer), arg unsafe.Pointer, stat *uint64) { f.size = size f.first = first f.arg = arg @@ -51,7 +51,7 @@ func fixAlloc_Init(f *fixalloc, size uintptr, first func(arg, p unsafe.Pointer), f.stat = stat } -func fixAlloc_Alloc(f *fixalloc) unsafe.Pointer { +func (f *fixalloc) alloc() unsafe.Pointer { if f.size == 0 { print("runtime: use of FixAlloc_Alloc before FixAlloc_Init\n") throw("runtime: internal error") @@ -78,7 +78,7 @@ func fixAlloc_Alloc(f *fixalloc) unsafe.Pointer { return v } -func fixAlloc_Free(f *fixalloc, p unsafe.Pointer) { +func (f *fixalloc) free(p unsafe.Pointer) { f.inuse -= f.size v := (*mlink)(p) v.next = f.list |