// Free release a []byte that alloc from Pool.Alloc.
178307
func (pool *SyncPool) Free(mem []byte) {
	if size := cap(mem); size <= pool.maxSize {
		for i := 0; i < len(pool.classesSize); i++ {
			if pool.classesSize[i] >= size {
				pool.classes[i].Put(&mem)
				return
			}
		}
	}
}
96703
func (a *Allocator) Release(ctx context.Context, key AllocatorKey) (lastUse bool, err error) {
	log.WithField(fieldKey, key).Info("Releasing key")

	select {
	case <-a.initialListDone:
	case <-ctx.Done():
		return false, fmt.Errorf("release was cancelled while waiting for initial key list to be received: %s", ctx.Err())
	}

	k := key.GetKey()
	// release the key locally, if it was the last use, remove the node
	// specific value key to remove the global reference mark
	lastUse, err = a.localKeys.release(k)
	if err != nil {
		return
	}

	if lastUse {
		valueKey := path.Join(a.valuePrefix, k, a.suffix)
		if err := kvstore.Delete(valueKey); err != nil {
			log.WithError(err).WithFields(logrus.Fields{fieldKey: key}).Warning("Ignoring node specific ID")
		}

		// if a.lockless {
		// FIXME: etcd 3.3 will make it possible to do a lockless
		// cleanup of the ID and release it right away. For now we rely
		// on the GC to kick in a release unused IDs.
		// }
	}

	return
}
288705
func (m *Mutex) Unlock() bool {
	n := m.actOnPoolsAsync(func(pool Pool) bool {
		return m.release(pool, m.value)
	})
	return n >= m.quorum
}
551265
func (bp *BufferPool) Release(buf *bytes.Buffer) {
	buf.Reset()
	bp.pool.Put(buf)
}
416048
func makeSlice(n int) []byte {
	if n <= 64 {
		return pool64.Get().([]byte)[0:n]
	}

	pn := poolNum(n)

	if pn != -1 {
		return pools[pn].Get().([]byte)[0:n]
	} else {
		return make([]byte, n)
	}
}
957312
func (b *Buffer) Release() {
	p := b.p
	if p == nil {
		panic("double Release")
	}

	b.p = nil
	b.Reset()
	p.pool.Put(b.Buffer)
}
1360645
func (pl *List) releaseAll(errs error, peers []*peerThunk) error {
	for _, t := range peers {
		if err := pl.transport.ReleasePeer(t.peer, t); err != nil {
			errs = multierr.Append(errs, err)
		}
	}
	return errs
}
724547
func (a *MinMaxAllocator) Release(i int) error {
	a.lock.Lock()
	defer a.lock.Unlock()

	if !a.has(i) {
		return nil
	}

	delete(a.used, i)

	if a.inRange(i) {
		a.free++
	}

	return nil
}
996886
func (la *Lattice) Free() {
	la.Input = ""
	la.Output = la.Output[:0]
	for i := range la.list {
		for j := range la.list[i] {
			nodePool.Put(la.list[i][j])
		}
		la.list[i] = la.list[i][:0]
	}
	la.list = la.list[:0]
	la.udic = nil
	latticePool.Put(la)
}
1197715
func (a *allocator) ReleaseAddress(poolID string, address net.IP) error {
	var relAddress string
	if address != nil {
		relAddress = address.String()
	}
	req := &api.ReleaseAddressRequest{PoolID: poolID, Address: relAddress}
	res := &api.ReleaseAddressResponse{}
	return a.call("ReleaseAddress", req, res)
}
110162
func (f *freelist) release(txid txid) {
	m := make(pgids, 0)
	for tid, ids := range f.pending {
		if tid <= txid {
			// Move transaction's pending pages to the available freelist.
			// Don't remove from the cache since the page is still free.
			m = append(m, ids...)
			delete(f.pending, tid)
		}
	}
	sort.Sort(m)
	f.ids = pgids(f.ids).merge(m)
}
314353
func (alloc *Allocator) Alloc(tableID int64) (int64, error) {
	return atomic.AddInt64(&alloc.base, 1), nil
}
668812
func (idx *NetworkIndex) Release() {
	for _, b := range idx.UsedPorts {
		bitmapPool.Put(b)
	}
}
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
}
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))
}
957767
func ReleaseBytes(bytes []byte) bool {
	capacity := int64(cap(bytes))
	if capacity < 512 || capacity > maxSize || capacity != pow2roundup(capacity) {
		return false
	}
	bytePool[log2(capacity)-9].Put(bytes)
	return true
}
1163826
func (c *Pool) Release(ctx Context) {
	ctx.EndRequest()
	c.pool.Put(ctx)
}