diff options
| author | Russ Cox <rsc@golang.org> | 2011-01-28 15:03:26 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-01-28 15:03:26 -0500 |
| commit | 4608feb18b515ef7e01b906913b10bbca9d6b08a (patch) | |
| tree | a5ff234c0700eb971b2f64f3a85786738462bb9f /src/pkg/runtime/proc.c | |
| parent | 50f574515c104d7235c5a659f441a787e22abcc1 (diff) | |
| download | go-4608feb18b515ef7e01b906913b10bbca9d6b08a.tar.xz | |
runtime: simpler heap map, memory allocation
The old heap maps used a multilevel table, but that
was overkill: there are only 1M entries on a 32-bit
machine and we can arrange to use a dense address
range on a 64-bit machine.
The heap map is in bss. The assumption is that if
we don't touch the pages they won't be mapped in.
Also moved some duplicated memory allocation
code out of the OS-specific files.
R=r
CC=golang-dev
https://golang.org/cl/4118042
Diffstat (limited to 'src/pkg/runtime/proc.c')
| -rw-r--r-- | src/pkg/runtime/proc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 246783e82d..62872d989c 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -1190,3 +1190,9 @@ runtime·Goroutines(int32 ret) ret = runtime·sched.gcount; FLUSH(&ret); } + +int32 +runtime·mcount(void) +{ + return runtime·sched.mcount; +} |
