// Release puts the given bytes.Buffer back in the specified pool after
// resetting it
551265
func (bp *BufferPool) Release(buf *bytes.Buffer) {
	buf.Reset()
	bp.pool.Put(buf)
}
637003
func (r *Range) Release(ip net.IP) error {
	ok, offset := r.contains(ip)
	if !ok {
		return nil
	}

	return r.alloc.Release(offset)
}
139117
func (h *Handle) Release() {
	nPtr := atomic.LoadPointer(&h.n)
	if nPtr != nil && atomic.CompareAndSwapPointer(&h.n, nPtr, nil) {
		n := (*Node)(nPtr)
		n.unrefLocked()
	}
}
1231573
func (bp *SizedBufferPool) Put(b *bytes.Buffer) {
	b.Reset()

	// Release buffers over our maximum capacity and re-create a pre-sized
	// buffer to replace it.
	// Note that the cap(b.Bytes()) provides the capacity from the read off-set
	// only, but as we've called b.Reset() the full capacity of the underlying
	// byte slice is returned.
	if cap(b.Bytes()) > bp.a {
		b = bytes.NewBuffer(make([]byte, 0, bp.a))
	}

	select {
	case bp.c <- b:
	default: // Discard the buffer if the pool is full.
	}
}
1249424
func (r *PortAllocator) Release(port int) error {
	ok, offset := r.contains(port)
	if !ok {
		klog.Warningf("port is not in the range when release it. port: %v", port)
		return nil
	}

	return r.alloc.Release(offset)
}
181679
func (a *allocator) release(n int) {
	a.pool.SetBit(a.pool, n-a.low, free)
}
802367
func (lk *localKeys) release(key string) (lastUse bool, err error) {
	lk.Lock()
	defer lk.Unlock()
	if k, ok := lk.keys[key]; ok {
		k.refcnt--
		kvstore.Trace("Decremented local key refcnt", nil, logrus.Fields{fieldKey: key, fieldID: k.val, fieldRefCnt: k.refcnt})
		if k.refcnt == 0 {
			delete(lk.keys, key)
			delete(lk.ids, k.val)
			return true, nil
		}

		return false, nil
	}

	return false, fmt.Errorf("unable to find key in local cache")
}
957312
func (b *Buffer) Release() {
	p := b.p
	if p == nil {
		panic("double Release")
	}

	b.p = nil
	b.Reset()
	p.pool.Put(b.Buffer)
}
668812
func (idx *NetworkIndex) Release() {
	for _, b := range idx.UsedPorts {
		bitmapPool.Put(b)
	}
}
262289
func (n *Name) Release() error {
	if n == nil || n.C_gss_name_t == nil {
		return nil
	}

	var min C.OM_uint32
	maj := C.wrap_gss_release_name(n.Fp_gss_release_name, &min, &n.C_gss_name_t)
	err := n.stashLastStatus(maj, min)
	if err == nil {
		n.C_gss_name_t = nil
	}
	return err
}
600835
func (snap *dbCacheSnapshot) Release() {
	snap.dbSnapshot.Release()
	snap.pendingKeys = nil
	snap.pendingRemove = nil
}
1008448
func (p *ConnectionPool) Release(c *Connection, err error) {
	if c == nil {
		return
	}

	if err != nil {
		p.retryNewConnection(nil)
		return
	}
	p.pool <- c
}
1012804
func (s *Server) Release() {
	// Block all new incomming socket connections.
	s.Block(true)

	// Wait for a little moment, so new incomming sockets are added
	// to the sockets active list.
	time.Sleep(200 * time.Millisecond)

	// Close all current connected sockets.
	sockets := s.Sockets()
	for _, s := range sockets {
		s.Close()
	}
}
122766
func (r *Allocator) Release(block uid.Block) error {
	ok, offset := r.contains(block)
	if !ok {
		// TODO: log a warning
		return nil
	}

	return r.alloc.Release(int(offset))
}
1142456
func (cn *conn) release() {
	cn.c.putFreeConn(cn.srv.Addr, cn)
}
782632
func (sm *SourceMgr) Release() {
	// Set sm.releasing before entering the Once func to guarantee that no
	// _more_ method calls will stack up if/while waiting.
	atomic.CompareAndSwapInt32(&sm.releasing, 0, 1)

	// Whether 'releasing' is set or not, we don't want this function to return
	// until after the doRelease process is done, as doing so could cause the
	// process to terminate before a signal-driven doRelease() call has a chance
	// to finish its cleanup.
	sm.relonce.Do(func() { sm.doRelease() })
}
707579
func (b *Buffer) Release() error {
	if b == nil || b.C_gss_buffer_t == nil {
		return nil
	}

	defer func() {
		C.free(unsafe.Pointer(b.C_gss_buffer_t))
		b.C_gss_buffer_t = nil
		b.alloc = allocNone
	}()

	// free the value as needed
	switch {
	case b.C_gss_buffer_t.value == nil:
		// do nothing

	case b.alloc == allocMalloc:
		C.free(b.C_gss_buffer_t.value)

	case b.alloc == allocGSSAPI:
		var min C.OM_uint32
		maj := C.wrap_gss_release_buffer(b.Fp_gss_release_buffer, &min, b.C_gss_buffer_t)
		err := b.stashLastStatus(maj, min)
		if err != nil {
			return err
		}
	}

	return nil
}