aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.h
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-10-03 12:44:20 -0400
committerRuss Cox <rsc@golang.org>2014-10-03 12:44:20 -0400
commit3ffd29fb2cfeee77c7f58fcae3496665695eb938 (patch)
tree4f09c078f4d7d7cef4e957c32e7919dfb23800d3 /src/runtime/malloc.h
parentc65a47f890e33eeed6ee9d8b6d965a5534fb6e0e (diff)
downloadgo-3ffd29fb2cfeee77c7f58fcae3496665695eb938.tar.xz
cmd/cc, runtime: disallow structs without tags
Structs without tags have no unique name to use in the Go definitions generated from the C types. This caused issue 8812, fixed by CL 149260043. Avoid future problems by requiring struct tags. Update runtime as needed. (There is no other C code in the tree.) LGTM=bradfitz, iant R=golang-codereviews, bradfitz, dave, iant CC=golang-codereviews, khr, r https://golang.org/cl/150360043
Diffstat (limited to 'src/runtime/malloc.h')
-rw-r--r--src/runtime/malloc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/malloc.h b/src/runtime/malloc.h
index b90f1baf29..d1930756a2 100644
--- a/src/runtime/malloc.h
+++ b/src/runtime/malloc.h
@@ -273,7 +273,8 @@ struct MStats
bool debuggc;
// Statistics about allocation size classes.
- struct {
+
+ struct MStatsBySize {
uint32 size;
uint64 nmalloc;
uint64 nfree;
@@ -282,6 +283,7 @@ struct MStats
uint64 tinyallocs; // number of tiny allocations that didn't cause actual allocation; not exported to Go directly
};
+
#define mstats runtime·memstats
extern MStats mstats;
void runtime·updatememstats(GCStats *stats);
@@ -489,7 +491,7 @@ struct MHeap
// the padding makes sure that the MCentrals are
// spaced CacheLineSize bytes apart, so that each MCentral.lock
// gets its own cache line.
- struct {
+ struct MHeapCentral {
MCentral mcentral;
byte pad[CacheLineSize];
} central[NumSizeClasses];