aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2014-08-07 09:00:02 -0400
committerRuss Cox <rsc@golang.org>2014-08-07 09:00:02 -0400
commite03bce158fba5f13dd7f2f0a86a40eb14958300b (patch)
tree4cd6d9b5a645be10fe84807e8014ac54d4445d88 /src/pkg/runtime/malloc.h
parent6cee4d3e8f52d4ab5ba2f97ca58f11d5e4c29fd4 (diff)
downloadgo-e03bce158fba5f13dd7f2f0a86a40eb14958300b.tar.xz
cmd/cc, runtime: eliminate use of the unnamed substructure C extension
Eliminating use of this extension makes it easier to port the Go runtime to other compilers. This CL also disables the extension in cc to prevent accidental use. LGTM=rsc, khr R=rsc, aram, khr, dvyukov CC=axwalk, golang-codereviews https://golang.org/cl/106790044
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index 4b16c55536..593e9b885b 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -370,7 +370,7 @@ struct Special
typedef struct SpecialFinalizer SpecialFinalizer;
struct SpecialFinalizer
{
- Special;
+ Special special;
FuncVal* fn;
uintptr nret;
Type* fint;
@@ -382,7 +382,7 @@ typedef struct Bucket Bucket; // from mprof.h
typedef struct SpecialProfile SpecialProfile;
struct SpecialProfile
{
- Special;
+ Special special;
Bucket* b;
};
@@ -438,7 +438,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 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)
@@ -454,7 +454,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 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
@@ -483,7 +483,7 @@ struct MHeap
// spaced CacheLineSize bytes apart, so that each MCentral.Lock
// gets its own cache line.
struct {
- MCentral;
+ MCentral mcentral;
byte pad[CacheLineSize];
} central[NumSizeClasses];