// withFinalizer associates a finalizer with the Reference that will cause it
// to print a leak message if it is not closed before it is garbage collected.
187159
func (l *liveReferences) track(r *Reference) *Reference {
	if !resourceDebugEnabled {
		return r
	}

	var buf [32]uintptr
	pcs := append([]uintptr(nil), buf[:runtime.Callers(3, buf[:])]...)

	l.mu.Lock()
	r.id, l.id = l.id, l.id+1
	l.live[r.id] = pcs
	l.mu.Unlock()

	runtime.SetFinalizer(r, func(r *Reference) {
		l.leaked(r)
		r.Release()
	})

	return r
}
911917
func (b *Adaptor) Finalize() (err error) {
	b.mutex.Lock()
	defer b.mutex.Unlock()

	for _, pin := range b.digitalPins {
		if pin != nil {
			if e := pin.Unexport(); e != nil {
				err = multierror.Append(err, e)
			}
		}
	}
	for _, pin := range b.pwmPins {
		if pin != nil {
			if e := pin.Unexport(); e != nil {
				err = multierror.Append(err, e)
			}
		}
	}
	for _, bus := range b.i2cBuses {
		if bus != nil {
			if e := bus.Close(); e != nil {
				err = multierror.Append(err, e)
			}
		}
	}
	for _, bus := range b.spiBuses {
		if bus != nil {
			if e := bus.Close(); e != nil {
				err = multierror.Append(err, e)
			}
		}
	}
	return
}
382540
func validateKubeFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if len(strings.Split(stringValue, "/")) == 1 {
		if !helper.IsStandardFinalizerName(stringValue) {
			return append(allErrs, field.Invalid(fldPath, stringValue, "name is neither a standard finalizer name nor is it fully qualified"))
		}
	}

	return allErrs
}
139679
func WithCompressor(cp Compressor) DialOption {
	return newFuncDialOption(func(o *dialOptions) {
		o.cp = cp
	})
}
165226
func (s *TrainingJob) SetFinalMetricDataList(v []*MetricData) *TrainingJob {
	s.FinalMetricDataList = v
	return s
}
1308662
func (fbo *folderBranchOps) finalizeResolution(ctx context.Context,
	lState *kbfssync.LockState, md *RootMetadata, bps blockPutState,
	newOps []op, blocksToDelete []kbfsblock.ID) error {
	// Take the writer lock.
	fbo.mdWriterLock.Lock(lState)
	defer fbo.mdWriterLock.Unlock(lState)
	return fbo.finalizeResolutionLocked(
		ctx, lState, md, bps, newOps, blocksToDelete)
}
905546
func (f Filter) EndsWith(val interface{}) Filter {
	f.Op = "$="
	f.Val = val
	return f
}
558436
func (c *Compiler) WithStageAfter(after string, stage CompilerStage) *Compiler {
	c.after[after] = append(c.after[after], stage)
	return c
}
1015388
func (e *GT) Finalize() *GT {
	ret := finalExponentiation(e.p)
	e.p.Set(ret)
	return e
}
238258
func WithExpirationProvider(expirationProvider ExpirationProvider, expiryType ExpirationType) options.Opt {
	return func(p options.Params) {
		logger.Debug("Checking expirationProviderSetter")
		if setter, ok := p.(expirationProviderSetter); ok {
			setter.SetExpirationProvider(expirationProvider, expiryType)
		}
	}
}
535003
func (mr *MockBytesMockRecorder) Finalizer() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Finalizer", reflect.TypeOf((*MockBytes)(nil).Finalizer))
}
997213
func (m *MockBytes) Finalizer() resource.Finalizer {
	ret := m.ctrl.Call(m, "Finalizer")
	ret0, _ := ret[0].(resource.Finalizer)
	return ret0
}
1203610
func (m *Method) FinalFunc(f FinalFunc) *Method {
	m.finalFuncs = append(m.finalFuncs, f)
	return m
}
926706
func (c *cache) finalizer() {
	if c.mmap != nil {
		c.mmap.Unmap()
		c.dump.Close()
		c.mmap, c.dump = nil, nil
	}
}
1365560
func WithOrderer(orderer fab.Orderer) Option {
	return func(opts *Opts) error {
		opts.Orderer = orderer
		return nil
	}
}
1145026
func (s *Server) WithNonceGenerator(ng NonceGeneratorFcn) *Server {
	s.Lock()
	defer s.Unlock()
	s.nonceGen = ng
	return s
}
973474
func (d *dataset) finalizer() {
	if d.mmap != nil {
		d.mmap.Unmap()
		d.dump.Close()
		d.mmap, d.dump = nil, nil
	}
}