Line data Source code
1 : // Copyright 2021 The LevelDB-Go and Pebble Authors. All rights reserved. Use 2 : // of this source code is governed by a BSD-style license that can be found in 3 : // the LICENSE file. 4 : 5 : //go:build (invariants && !race) || (tracing && !race) 6 : // +build invariants,!race tracing,!race 7 : 8 : package invariants 9 : 10 : import "runtime" 11 : 12 : // SetFinalizer is a wrapper around runtime.SetFinalizer that is a no-op under 13 : // race builds or if neither the invariants or tracing build tags are 14 : // specified. 15 1 : func SetFinalizer(obj, finalizer interface{}) { 16 1 : runtime.SetFinalizer(obj, finalizer) 17 1 : }