diff options
| author | Russ Cox <rsc@golang.org> | 2014-11-11 17:05:02 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-11-11 17:05:02 -0500 |
| commit | 1e2d2f09470a2be58a98420b4cecae731b156ee8 (patch) | |
| tree | 4e787523cc5b7e166ff675e1d3da6b1da2207170 /src/runtime/mprof.go | |
| parent | d98553a72782efb2d96c6d6f5e12869826a56779 (diff) | |
| download | go-1e2d2f09470a2be58a98420b4cecae731b156ee8.tar.xz | |
[dev.cc] runtime: convert memory allocator and garbage collector to Go
The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/167540043
Diffstat (limited to 'src/runtime/mprof.go')
| -rw-r--r-- | src/runtime/mprof.go | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/runtime/mprof.go b/src/runtime/mprof.go index d409c6c306..6ff33743b7 100644 --- a/src/runtime/mprof.go +++ b/src/runtime/mprof.go @@ -190,8 +190,6 @@ func stkbucket(typ bucketType, size uintptr, stk []uintptr, alloc bool) *bucket return b } -func sysAlloc(n uintptr, stat *uint64) unsafe.Pointer - func eqslice(x, y []uintptr) bool { if len(x) != len(y) { return false @@ -246,16 +244,9 @@ func mProf_Malloc(p unsafe.Pointer, size uintptr) { // This reduces potential contention and chances of deadlocks. // Since the object must be alive during call to mProf_Malloc, // it's fine to do this non-atomically. - setprofilebucket(p, b) -} - -func setprofilebucket_m() // mheap.c - -func setprofilebucket(p unsafe.Pointer, b *bucket) { - g := getg() - g.m.ptrarg[0] = p - g.m.ptrarg[1] = unsafe.Pointer(b) - onM(setprofilebucket_m) + onM(func() { + setprofilebucket(p, b) + }) } // Called when freeing a profiled block. @@ -519,8 +510,6 @@ func ThreadCreateProfile(p []StackRecord) (n int, ok bool) { return } -var allgs []*g // proc.c - // GoroutineProfile returns n, the number of records in the active goroutine stack profile. // If len(p) >= n, GoroutineProfile copies the profile into p and returns n, true. // If len(p) < n, GoroutineProfile does not change p and returns n, false. |
