aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.goc
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-10-23 02:33:51 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-10-23 02:33:51 +0800
commit7c44edf4250d8e1ad0ed37bf4ae27ec7f6c07ab6 (patch)
tree64b5ea70362a78144d336498913446ff63d0e99b /src/pkg/runtime/malloc.goc
parent7c03cd32b6612f153cf6362ead27e86af6e65336 (diff)
downloadgo-7c44edf4250d8e1ad0ed37bf4ae27ec7f6c07ab6.tar.xz
runtime, runtime/race: add missing if(raceenabled), update package docs of pkg race
R=dvyukov CC=golang-dev https://golang.org/cl/6733058
Diffstat (limited to 'src/pkg/runtime/malloc.goc')
-rw-r--r--src/pkg/runtime/malloc.goc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc
index eaae52a641..f8aa1c949e 100644
--- a/src/pkg/runtime/malloc.goc
+++ b/src/pkg/runtime/malloc.goc
@@ -715,7 +715,8 @@ runtime·cnew(Type *typ)
uint32 flag;
void *ret;
- m->racepc = runtime·getcallerpc(&typ);
+ if(raceenabled)
+ m->racepc = runtime·getcallerpc(&typ);
flag = typ->kind&KindNoPointers ? FlagNoPointers : 0;
ret = runtime·mallocgc(typ->size, flag, 1, 1);