aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-07-30 09:01:52 -0700
committerKeith Randall <khr@golang.org>2014-07-30 09:01:52 -0700
commit4aa50434e13d12eb9755a992d6d4ad93e201d624 (patch)
tree16bdb1935477b9d70d443d2b1f5c0bcb4c636682 /src/pkg/runtime/malloc.h
parentfe4fc94b044df5e6d08ad9e480f0bce70cc4e5d5 (diff)
downloadgo-4aa50434e13d12eb9755a992d6d4ad93e201d624.tar.xz
runtime: rewrite malloc in Go.
This change introduces gomallocgc, a Go clone of mallocgc. Only a few uses have been moved over, so there are still lots of uses from C. Many of these C uses will be moved over to Go (e.g. in slice.goc), but probably not all. What should remain of C's mallocgc is an open question. LGTM=rsc, dvyukov R=rsc, khr, dave, bradfitz, dvyukov CC=golang-codereviews https://golang.org/cl/108840046
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index a6425581f3..50656e4ee9 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -280,7 +280,7 @@ struct MStats
} by_size[NumSizeClasses];
};
-#define mstats runtime·memStats
+#define mstats runtime·memstats
extern MStats mstats;
void runtime·updatememstats(GCStats *stats);
@@ -500,6 +500,7 @@ struct MHeap
uint64 nlargefree; // number of frees for large objects (>MaxSmallSize)
uint64 nsmallfree[NumSizeClasses]; // number of frees for small objects (<=MaxSmallSize)
};
+#define runtime·mheap runtime·mheap_
extern MHeap runtime·mheap;
void runtime·MHeap_Init(MHeap *h);
@@ -531,6 +532,10 @@ void runtime·tracealloc(void*, uintptr, Type*);
void runtime·tracefree(void*, uintptr);
void runtime·tracegc(void);
+int32 runtime·gcpercent;
+int32 runtime·readgogc(void);
+void runtime·clearpools(void);
+
enum
{
// flags to malloc
@@ -551,6 +556,7 @@ void runtime·gchelper(void);
void runtime·createfing(void);
G* runtime·wakefing(void);
void runtime·getgcmask(byte*, Type*, byte**, uintptr*);
+extern G* runtime·fing;
extern bool runtime·fingwait;
extern bool runtime·fingwake;