mirror of
https://github.com/golang/go
synced 2024-10-05 10:21:22 -06:00
1a19f01a68
Currently race detector runtime maps shadow memory eagerly at process startup. It works poorly on Windows, because Windows requires reservation in swap file (especially problematic if several Go program runs at the same, each consuming GBs of memory). With this change race detector maps shadow memory lazily, so Go runtime must notify about all new heap memory. It will help with Windows port, but also eliminates scary 16TB virtual mememory consumption in top output (which sometimes confuses some monitoring scripts). R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6811085
112 lines
1.2 KiB
C
112 lines
1.2 KiB
C
// Copyright 2011 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Stub implementation of the race detector API.
|
|
// +build !race
|
|
|
|
#include "runtime.h"
|
|
|
|
void
|
|
runtime·raceinit(void)
|
|
{
|
|
}
|
|
|
|
void
|
|
runtime·racefini(void)
|
|
{
|
|
}
|
|
|
|
|
|
void
|
|
runtime·racemapshadow(void *addr, uintptr size)
|
|
{
|
|
USED(addr);
|
|
USED(size);
|
|
}
|
|
|
|
void
|
|
runtime·racewritepc(void *addr, void *pc)
|
|
{
|
|
USED(addr);
|
|
USED(pc);
|
|
}
|
|
|
|
void
|
|
runtime·racereadpc(void *addr, void *pc)
|
|
{
|
|
USED(addr);
|
|
USED(pc);
|
|
}
|
|
|
|
void
|
|
runtime·raceacquire(void *addr)
|
|
{
|
|
USED(addr);
|
|
}
|
|
|
|
void
|
|
runtime·raceacquireg(G *gp, void *addr)
|
|
{
|
|
USED(gp);
|
|
USED(addr);
|
|
}
|
|
|
|
void
|
|
runtime·racerelease(void *addr)
|
|
{
|
|
USED(addr);
|
|
}
|
|
|
|
void
|
|
runtime·racereleaseg(G *gp, void *addr)
|
|
{
|
|
USED(gp);
|
|
USED(addr);
|
|
}
|
|
|
|
void
|
|
runtime·racereleasemerge(void *addr)
|
|
{
|
|
USED(addr);
|
|
}
|
|
|
|
void
|
|
runtime·racereleasemergeg(G *gp, void *addr)
|
|
{
|
|
USED(gp);
|
|
USED(addr);
|
|
}
|
|
|
|
void
|
|
runtime·racefingo(void)
|
|
{
|
|
}
|
|
|
|
void
|
|
runtime·racemalloc(void *p, uintptr sz, void *pc)
|
|
{
|
|
USED(p);
|
|
USED(sz);
|
|
USED(pc);
|
|
}
|
|
|
|
void
|
|
runtime·racefree(void *p)
|
|
{
|
|
USED(p);
|
|
}
|
|
|
|
void
|
|
runtime·racegostart(int32 goid, void *pc)
|
|
{
|
|
USED(goid);
|
|
USED(pc);
|
|
}
|
|
|
|
void
|
|
runtime·racegoend(int32 goid)
|
|
{
|
|
USED(goid);
|
|
}
|