aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-08-27 23:32:49 -0400
committerRuss Cox <rsc@golang.org>2014-08-27 23:32:49 -0400
commit8ecb9a765e02a8b19d8fad2afa65aee2a068b01a (patch)
tree66f7622c0f2b2c14943c0b0c5780d00987574e03 /src/pkg/runtime/malloc.h
parent299117eca0f28b6e379c4d5b7e43e2f13cf0cd36 (diff)
downloadgo-8ecb9a765e02a8b19d8fad2afa65aee2a068b01a.tar.xz
runtime: rename Lock to Mutex
Mutex is consistent with package sync, and when in the unexported Go form it avoids having a conflcit between the type (now mutex) and the function (lock). LGTM=iant R=golang-codereviews, iant CC=dvyukov, golang-codereviews, r https://golang.org/cl/133140043
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index 7a6d0c71d9..0d7cd475d8 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -242,7 +242,7 @@ struct MStats
uint64 nfree; // number of frees
// Statistics about malloc heap.
- // protected by mheap.Lock
+ // protected by mheap.lock
uint64 heap_alloc; // bytes allocated and still in use
uint64 heap_sys; // bytes obtained from system
uint64 heap_idle; // bytes in idle spans
@@ -421,7 +421,7 @@ struct MSpan
int64 unusedsince; // First time spotted by GC in MSpanFree state
uintptr npreleased; // number of pages released to the OS
byte *limit; // end of data in span
- Lock specialLock; // guards specials list
+ Mutex specialLock; // guards specials list
Special *specials; // linked list of special records sorted by offset.
};
@@ -442,7 +442,7 @@ void runtime·MSpanList_Remove(MSpan *span); // from whatever list it is in
// Central list of free objects of a given size.
struct MCentral
{
- Lock lock;
+ Mutex lock;
int32 sizeclass;
MSpan nonempty; // list of spans with a free object
MSpan empty; // list of spans with no free objects (or cached in an MCache)
@@ -458,7 +458,7 @@ bool runtime·MCentral_FreeSpan(MCentral *c, MSpan *s, int32 n, MLink *start, ML
// but all the other global data is here too.
struct MHeap
{
- Lock lock;
+ Mutex lock;
MSpan free[MaxMHeapList]; // free lists of given length
MSpan freelarge; // free lists length >= MaxMHeapList
MSpan busy[MaxMHeapList]; // busy lists of large objects of given length
@@ -484,7 +484,7 @@ struct MHeap
// central free lists for small size classes.
// the padding makes sure that the MCentrals are
- // spaced CacheLineSize bytes apart, so that each MCentral.Lock
+ // spaced CacheLineSize bytes apart, so that each MCentral.lock
// gets its own cache line.
struct {
MCentral mcentral;
@@ -495,7 +495,7 @@ struct MHeap
FixAlloc cachealloc; // allocator for MCache*
FixAlloc specialfinalizeralloc; // allocator for SpecialFinalizer*
FixAlloc specialprofilealloc; // allocator for SpecialProfile*
- Lock speciallock; // lock for sepcial record allocators.
+ Mutex speciallock; // lock for sepcial record allocators.
// Malloc stats.
uint64 largefree; // bytes freed for large objects (>MaxSmallSize)