]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove FlagNoProfile
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 12 Aug 2014 21:03:32 +0000 (01:03 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 12 Aug 2014 21:03:32 +0000 (01:03 +0400)
Turns out to be unused as well.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews, khr
https://golang.org/cl/127170044

src/pkg/runtime/malloc.go
src/pkg/runtime/malloc.h

index 73dc9f20d65b90187ab611f931b2c85e28f066ce..71c0a4ecd7dfb207c5e5d7261d53d00d8623ca2f 100644 (file)
@@ -11,9 +11,8 @@ import (
 const (
        debugMalloc = false
 
-       flagNoScan      = 1 << 0 // GC doesn't have to scan object
-       flagNoProfiling = 1 << 1 // must not profile
-       flagNoZero      = 1 << 2 // don't zero memory
+       flagNoScan = 1 << 0 // GC doesn't have to scan object
+       flagNoZero = 1 << 1 // don't zero memory
 
        kindArray      = 17
        kindFunc       = 19
@@ -300,14 +299,12 @@ marked:
        if debug.allocfreetrace != 0 {
                tracealloc(x, size, typ)
        }
-       if flags&flagNoProfiling == 0 {
-               rate := MemProfileRate
-               if rate > 0 {
-                       if size < uintptr(rate) && int32(size) < c.next_sample {
-                               c.next_sample -= int32(size)
-                       } else {
-                               profilealloc(mp, x, size)
-                       }
+
+       if rate := MemProfileRate; rate > 0 {
+               if size < uintptr(rate) && int32(size) < c.next_sample {
+                       c.next_sample -= int32(size)
+               } else {
+                       profilealloc(mp, x, size)
                }
        }
 
index 556d6d4c031710363af863d5d103cc49d7ebd90e..4612dddb16e4535f8e66926650f04ad8b0c8d0bb 100644 (file)
@@ -534,8 +534,7 @@ enum
 {
        // flags to malloc
        FlagNoScan      = 1<<0, // GC doesn't have to scan object
-       FlagNoProfiling = 1<<1, // must not profile
-       FlagNoZero      = 1<<2, // don't zero memory
+       FlagNoZero      = 1<<1, // don't zero memory
 };
 
 void   runtime·MProf_Malloc(void*, uintptr);