mirror of
https://github.com/golang/go
synced 2024-11-23 22:00:11 -07:00
runtime: remove dead code
runtime.free has long gone. Change-Id: I058f69e6481b8fa008e1951c29724731a8a3d081 Reviewed-on: https://go-review.googlesource.com/16593 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com>
This commit is contained in:
parent
b6c0934a9b
commit
ee0305e036
@ -233,7 +233,7 @@ func mSpan_Sweep(s *mspan, preserve bool) bool {
|
||||
y := special
|
||||
special = special.next
|
||||
*specialp = special
|
||||
freespecial(y, unsafe.Pointer(p), size, false)
|
||||
freespecial(y, unsafe.Pointer(p), size)
|
||||
} else {
|
||||
// This is profile record, but the object has finalizers (so kept alive).
|
||||
// Keep special record.
|
||||
|
@ -1143,7 +1143,7 @@ func setprofilebucket(p unsafe.Pointer, b *bucket) {
|
||||
|
||||
// Do whatever cleanup needs to be done to deallocate s. It has
|
||||
// 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 {
|
||||
case _KindSpecialFinalizer:
|
||||
sf := (*specialfinalizer)(unsafe.Pointer(s))
|
||||
@ -1153,7 +1153,7 @@ func freespecial(s *special, p unsafe.Pointer, size uintptr, freed bool) {
|
||||
unlock(&mheap_.speciallock)
|
||||
case _KindSpecialProfile:
|
||||
sp := (*specialprofile)(unsafe.Pointer(s))
|
||||
mProf_Free(sp.b, size, freed)
|
||||
mProf_Free(sp.b, size)
|
||||
lock(&mheap_.speciallock)
|
||||
fixAlloc_Free(&mheap_.specialprofilealloc, unsafe.Pointer(sp))
|
||||
unlock(&mheap_.speciallock)
|
||||
|
@ -250,16 +250,11 @@ func mProf_Malloc(p unsafe.Pointer, size uintptr) {
|
||||
}
|
||||
|
||||
// Called when freeing a profiled block.
|
||||
func mProf_Free(b *bucket, size uintptr, freed bool) {
|
||||
func mProf_Free(b *bucket, size uintptr) {
|
||||
lock(&proflock)
|
||||
mp := b.mp()
|
||||
if freed {
|
||||
mp.recent_frees++
|
||||
mp.recent_free_bytes += size
|
||||
} else {
|
||||
mp.prev_frees++
|
||||
mp.prev_free_bytes += size
|
||||
}
|
||||
mp.prev_frees++
|
||||
mp.prev_free_bytes += size
|
||||
unlock(&proflock)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user