bitmap.go

 1// Copyright 2024 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//go:build !race
 6
 7package impl
 8
 9// There is no additional data as we're not running under race detector.
10type RaceDetectHookData struct{}
11
12// Empty stubs for when not using the race detector. Calls to these from index.go should be optimized away.
13func (presence) raceDetectHookPresent(num uint32)                       {}
14func (presence) raceDetectHookSetPresent(num uint32, size presenceSize) {}
15func (presence) raceDetectHookClearPresent(num uint32)                  {}
16func (presence) raceDetectHookAllocAndCopy(src presence)                {}
17
18// raceDetectHookPresent is called by the generated file interface
19// (*proto.internalFuncs) Present to optionally read an unprotected
20// shadow bitmap when race detection is enabled. In regular code it is
21// a noop.
22func raceDetectHookPresent(field *uint32, num uint32) {}
23
24// raceDetectHookSetPresent is called by the generated file interface
25// (*proto.internalFuncs) SetPresent to optionally write an unprotected
26// shadow bitmap when race detection is enabled. In regular code it is
27// a noop.
28func raceDetectHookSetPresent(field *uint32, num uint32, size presenceSize) {}
29
30// raceDetectHookClearPresent is called by the generated file interface
31// (*proto.internalFuncs) ClearPresent to optionally write an unprotected
32// shadow bitmap when race detection is enabled. In regular code it is
33// a noop.
34func raceDetectHookClearPresent(field *uint32, num uint32) {}