// Cap returns the maximum number of elements that can be held by the cache.
349602
func (c *LRU) Cap() int {
	c.mu.RLock()
	defer c.mu.RUnlock()

	return c.cap
}
728315
func (s *ScalableTarget) SetMaxCapacity(v int64) *ScalableTarget {
	s.MaxCapacity = &v
	return s
}
860334
func (p *NodeDevice) ListCaps() ([]string, error) {
	const maxCaps = 1024
	var names [maxCaps](*C.char)
	namesPtr := unsafe.Pointer(&names)
	var err C.virError
	numCaps := C.virNodeDeviceListCapsWrapper(
		p.ptr,
		(**C.char)(namesPtr),
		maxCaps, &err)
	if numCaps == -1 {
		return nil, makeError(&err)
	}
	goNames := make([]string, numCaps)
	for k := 0; k < int(numCaps); k++ {
		goNames[k] = C.GoString(names[k])
		C.free(unsafe.Pointer(names[k]))
	}
	return goNames, nil
}
1288474
func (c *Cache) enforceCapacity() {
	// Check maxItems.
	if c.config.MaxItems > 0 {
		for c.l.Len() > c.config.MaxItems {
			if !c.dropTail() {
				break
			}
		}
	}
	// Check maxBytes.
	if c.config.MaxBytes > 0 {
		for c.size > c.config.MaxBytes {
			if !c.dropTail() {
				break
			}
		}
	}
}
1201927
func hasCap(needle string, haystack []corev1.Capability) bool {
	for _, c := range haystack {
		if needle == strings.ToUpper(string(c)) {
			return true
		}
	}
	return false
}
1051644
func (me *Cache) SetCapacity(capacity int64) {
	me.mu.Lock()
	defer me.mu.Unlock()
	me.capacity = capacity
}
1357217
func (s *CreateFileSystemInput) SetStorageCapacity(v int64) *CreateFileSystemInput {
	s.StorageCapacity = &v
	return s
}
195794
func (ec *Cache) Size() uint64 {
	ec.RLock()
	s := ec.totalSize
	ec.RUnlock()
	return s
}
863230
func (conn *Conn) Cap(subcommmand string, capabilities ...string) {
	if len(capabilities) == 0 {
		conn.Raw(CAP + " " + subcommmand)
	} else {
		conn.Raw(CAP + " " + subcommmand + " :" + strings.Join(capabilities, " "))
	}
}
236773
func (c *FIFO) Cap() int {
	c.mu.RLock()
	defer c.mu.RUnlock()

	return c.cap
}
818639
func (p *peer) updateCapacity(cap uint64) {
	p.responseLock.Lock()
	defer p.responseLock.Unlock()

	p.fcParams = flowcontrol.ServerParams{MinRecharge: cap, BufLimit: cap * bufLimitRatio}
	p.fcClient.UpdateParams(p.fcParams)
	var kvList keyValueList
	kvList = kvList.add("flowControl/MRR", cap)
	kvList = kvList.add("flowControl/BL", cap*bufLimitRatio)
	p.queueSend(func() { p.SendAnnounce(announceData{Update: kvList}) })
}
1080607
func (s *DBCluster) SetCapacity(v int64) *DBCluster {
	s.Capacity = &v
	return s
}
565938
func (h *ManagerStub) GetCapacity() (v1.ResourceList, v1.ResourceList, []string) {
	return nil, nil, []string{}
}
27015
func (r *Ring) SetCapacity(size int) {
	r.Lock()
	defer r.Unlock()

	r.checkInit()
	r.extend(size)
}
738853
func (s *JobUpdate) SetMaxCapacity(v float64) *JobUpdate {
	s.MaxCapacity = &v
	return s
}
487054
func (c *ExpireCache) Size() int64 {
	defer c.mutex.Unlock()
	c.mutex.Lock()
	return int64(len(c.cache))
}
1084021
func (db *StakeDatabase) SetPoolCacheCapacity(cap int) error {
	return db.poolInfo.SetCapacity(cap)
}