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
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;
}
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);
}
}
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;
}
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);
}
void
-runtime·racemalloc(void *p, uintptr sz, void *pc)
+runtime·racemalloc(void *p, uintptr sz)
{
USED(p);
USED(sz);
- USED(pc);
}
void
GCStats gcstats;
bool racecall;
bool needextram;
- void* racepc;
void (*waitunlockf)(Lock*);
void* waitlock;