Commit 1837419f authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: remove FlagNoProfile

Turns out to be unused as well.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews, khr
https://golang.org/cl/127170044
parent fe7b29f5
...@@ -11,9 +11,8 @@ import ( ...@@ -11,9 +11,8 @@ import (
const ( const (
debugMalloc = false debugMalloc = false
flagNoScan = 1 << 0 // GC doesn't have to scan object flagNoScan = 1 << 0 // GC doesn't have to scan object
flagNoProfiling = 1 << 1 // must not profile flagNoZero = 1 << 1 // don't zero memory
flagNoZero = 1 << 2 // don't zero memory
kindArray = 17 kindArray = 17
kindFunc = 19 kindFunc = 19
...@@ -300,14 +299,12 @@ marked: ...@@ -300,14 +299,12 @@ marked:
if debug.allocfreetrace != 0 { if debug.allocfreetrace != 0 {
tracealloc(x, size, typ) tracealloc(x, size, typ)
} }
if flags&flagNoProfiling == 0 {
rate := MemProfileRate if rate := MemProfileRate; rate > 0 {
if rate > 0 { if size < uintptr(rate) && int32(size) < c.next_sample {
if size < uintptr(rate) && int32(size) < c.next_sample { c.next_sample -= int32(size)
c.next_sample -= int32(size) } else {
} else { profilealloc(mp, x, size)
profilealloc(mp, x, size)
}
} }
} }
......
...@@ -534,8 +534,7 @@ enum ...@@ -534,8 +534,7 @@ enum
{ {
// flags to malloc // flags to malloc
FlagNoScan = 1<<0, // GC doesn't have to scan object FlagNoScan = 1<<0, // GC doesn't have to scan object
FlagNoProfiling = 1<<1, // must not profile FlagNoZero = 1<<1, // don't zero memory
FlagNoZero = 1<<2, // don't zero memory
}; };
void runtime·MProf_Malloc(void*, uintptr); void runtime·MProf_Malloc(void*, uintptr);
......
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