bitmap.go raw

   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  
   7  package impl
   8  
   9  // There is no additional data as we're not running under race detector.
  10  type RaceDetectHookData struct{}
  11  
  12  // Empty stubs for when not using the race detector. Calls to these from index.go should be optimized away.
  13  func (presence) raceDetectHookPresent(num uint32)                       {}
  14  func (presence) raceDetectHookSetPresent(num uint32, size presenceSize) {}
  15  func (presence) raceDetectHookClearPresent(num uint32)                  {}
  16  func (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.
  22  func 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.
  28  func 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.
  34  func raceDetectHookClearPresent(field *uint32, num uint32) {}
  35