Commit ee0305e0 authored by Dmitry Vyukov's avatar Dmitry Vyukov

runtime: remove dead code

runtime.free has long gone.

Change-Id: I058f69e6481b8fa008e1951c29724731a8a3d081
Reviewed-on: https://go-review.googlesource.com/16593Reviewed-by: default avatarAustin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
parent b6c0934a
...@@ -233,7 +233,7 @@ func mSpan_Sweep(s *mspan, preserve bool) bool { ...@@ -233,7 +233,7 @@ func mSpan_Sweep(s *mspan, preserve bool) bool {
y := special y := special
special = special.next special = special.next
*specialp = special *specialp = special
freespecial(y, unsafe.Pointer(p), size, false) freespecial(y, unsafe.Pointer(p), size)
} else { } else {
// This is profile record, but the object has finalizers (so kept alive). // This is profile record, but the object has finalizers (so kept alive).
// Keep special record. // Keep special record.
......
...@@ -1143,7 +1143,7 @@ func setprofilebucket(p unsafe.Pointer, b *bucket) { ...@@ -1143,7 +1143,7 @@ func setprofilebucket(p unsafe.Pointer, b *bucket) {
// Do whatever cleanup needs to be done to deallocate s. It has // Do whatever cleanup needs to be done to deallocate s. It has
// already been unlinked from the MSpan specials list. // already been unlinked from the MSpan specials list.
func freespecial(s *special, p unsafe.Pointer, size uintptr, freed bool) { func freespecial(s *special, p unsafe.Pointer, size uintptr) {
switch s.kind { switch s.kind {
case _KindSpecialFinalizer: case _KindSpecialFinalizer:
sf := (*specialfinalizer)(unsafe.Pointer(s)) sf := (*specialfinalizer)(unsafe.Pointer(s))
...@@ -1153,7 +1153,7 @@ func freespecial(s *special, p unsafe.Pointer, size uintptr, freed bool) { ...@@ -1153,7 +1153,7 @@ func freespecial(s *special, p unsafe.Pointer, size uintptr, freed bool) {
unlock(&mheap_.speciallock) unlock(&mheap_.speciallock)
case _KindSpecialProfile: case _KindSpecialProfile:
sp := (*specialprofile)(unsafe.Pointer(s)) sp := (*specialprofile)(unsafe.Pointer(s))
mProf_Free(sp.b, size, freed) mProf_Free(sp.b, size)
lock(&mheap_.speciallock) lock(&mheap_.speciallock)
fixAlloc_Free(&mheap_.specialprofilealloc, unsafe.Pointer(sp)) fixAlloc_Free(&mheap_.specialprofilealloc, unsafe.Pointer(sp))
unlock(&mheap_.speciallock) unlock(&mheap_.speciallock)
......
...@@ -250,16 +250,11 @@ func mProf_Malloc(p unsafe.Pointer, size uintptr) { ...@@ -250,16 +250,11 @@ func mProf_Malloc(p unsafe.Pointer, size uintptr) {
} }
// Called when freeing a profiled block. // Called when freeing a profiled block.
func mProf_Free(b *bucket, size uintptr, freed bool) { func mProf_Free(b *bucket, size uintptr) {
lock(&proflock) lock(&proflock)
mp := b.mp() mp := b.mp()
if freed {
mp.recent_frees++
mp.recent_free_bytes += size
} else {
mp.prev_frees++ mp.prev_frees++
mp.prev_free_bytes += size mp.prev_free_bytes += size
}
unlock(&proflock) unlock(&proflock)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment