blob: 591d5d9c8aa46dd68f2f90a9aee09505bfd22eac [file] [log] [blame]
Keith Randall61dca942014-06-16 23:03:03 -07001// Copyright 2014 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build !race
6
7// Dummy race detection API, used when not built with -race.
8
9package runtime
10
Keith Randall0c6b55e2014-07-16 14:16:19 -070011import (
12 "unsafe"
13)
14
Keith Randall61dca942014-06-16 23:03:03 -070015const raceenabled = false
Keith Randall0c6b55e2014-07-16 14:16:19 -070016
Russ Coxf545b052014-09-04 15:53:45 -040017// Because raceenabled is false, none of these functions should be called.
18
Keith Randallb2a950b2014-12-27 20:58:00 -080019func raceReadObjectPC(t *_type, addr unsafe.Pointer, callerpc, pc uintptr) { throw("race") }
20func raceWriteObjectPC(t *_type, addr unsafe.Pointer, callerpc, pc uintptr) { throw("race") }
21func raceinit() uintptr { throw("race"); return 0 }
22func racefini() { throw("race") }
23func racemapshadow(addr unsafe.Pointer, size uintptr) { throw("race") }
24func racewritepc(addr unsafe.Pointer, callerpc, pc uintptr) { throw("race") }
25func racereadpc(addr unsafe.Pointer, callerpc, pc uintptr) { throw("race") }
26func racereadrangepc(addr unsafe.Pointer, sz, callerpc, pc uintptr) { throw("race") }
27func racewriterangepc(addr unsafe.Pointer, sz, callerpc, pc uintptr) { throw("race") }
28func raceacquire(addr unsafe.Pointer) { throw("race") }
29func raceacquireg(gp *g, addr unsafe.Pointer) { throw("race") }
30func racerelease(addr unsafe.Pointer) { throw("race") }
31func racereleaseg(gp *g, addr unsafe.Pointer) { throw("race") }
32func racereleasemerge(addr unsafe.Pointer) { throw("race") }
33func racereleasemergeg(gp *g, addr unsafe.Pointer) { throw("race") }
34func racefingo() { throw("race") }
35func racemalloc(p unsafe.Pointer, sz uintptr) { throw("race") }
36func racegostart(pc uintptr) uintptr { throw("race"); return 0 }
37func racegoend() { throw("race") }