]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove unused m->racepc
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 12 Aug 2013 17:48:19 +0000 (21:48 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 12 Aug 2013 17:48:19 +0000 (21:48 +0400)
The original plan was to collect allocation stacks
for all memory blocks. But it was never implemented
and it's not in near plans and it's unclear how to do it at all.

R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/12724044

src/pkg/runtime/malloc.goc
src/pkg/runtime/race.c
src/pkg/runtime/race.h
src/pkg/runtime/race0.c
src/pkg/runtime/runtime.h

index 9ab8e0756da3b5faa6f15130d57c5399c7f70177..b146ae25406c8621ffd7ae5250514c23b2ed12e5 100644 (file)
@@ -141,10 +141,8 @@ runtime·mallocgc(uintptr size, uintptr typ, uint32 flag)
        if(!(flag & FlagNoInvokeGC) && mstats.heap_alloc >= mstats.next_gc)
                runtime·gc(0);
 
-       if(raceenabled) {
-               runtime·racemalloc(v, size, m->racepc);
-               m->racepc = nil;
-       }
+       if(raceenabled)
+               runtime·racemalloc(v, size);
        return v;
 }
 
@@ -702,8 +700,6 @@ runtime·mal(uintptr n)
 void
 runtime·new(Type *typ, uint8 *ret)
 {
-       if(raceenabled)
-               m->racepc = runtime·getcallerpc(&typ);
        ret = runtime·mallocgc(typ->size, (uintptr)typ | TypeInfo_SingleObject, typ->kind&KindNoPointers ? FlagNoPointers : 0);
        FLUSH(&ret);
 }
index 875375da2858610a7da239005d0bf53fde800ee6..0f2a7b986e246b754c6df257e1193006d377791b 100644 (file)
@@ -138,13 +138,13 @@ runtime·racefuncexit(void)
 }
 
 void
-runtime·racemalloc(void *p, uintptr sz, void *pc)
+runtime·racemalloc(void *p, uintptr sz)
 {
        // use m->curg because runtime·stackalloc() is called from g0
        if(m->curg == nil)
                return;
        m->racecall = true;
-       runtime∕race·Malloc(m->curg->racectx, p, sz, pc);
+       runtime∕race·Malloc(m->curg->racectx, p, sz, /* unused pc */ 0);
        m->racecall = false;
 }
 
index 971783bf0c7c97832b17d03fa54a1ecd76d3d38b..f7aa99dc2aebd4d10eb4e651ee72914ce39884e0 100644 (file)
@@ -16,7 +16,7 @@ uintptr       runtime·raceinit(void);
 void   runtime·racefini(void);
 
 void   runtime·racemapshadow(void *addr, uintptr size);
-void   runtime·racemalloc(void *p, uintptr sz, void *pc);
+void   runtime·racemalloc(void *p, uintptr sz);
 void   runtime·racefree(void *p);
 uintptr        runtime·racegostart(void *pc);
 void   runtime·racegoend(void);
index 0ebc099838a69041fdc52f9b88d8bccf3cad7b6a..b74b03583b7edcdf811b98ca5a4eb57e71183270 100644 (file)
@@ -105,11 +105,10 @@ runtime·racefingo(void)
 }
 
 void
-runtime·racemalloc(void *p, uintptr sz, void *pc)
+runtime·racemalloc(void *p, uintptr sz)
 {
        USED(p);
        USED(sz);
-       USED(pc);
 }
 
 void
index a3edb5e9551aabce7bc6d939f9a40c9b57607d0b..a81408f40f5bd41f3db275b8e3d845f962a87d8d 100644 (file)
@@ -339,7 +339,6 @@ struct      M
        GCStats gcstats;
        bool    racecall;
        bool    needextram;
-       void*   racepc;
        void    (*waitunlockf)(Lock*);
        void*   waitlock;