MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / memoryCapacityBytes

Method memoryCapacityBytes

internal/caches/storage_memory.go:618–647  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

616}
617
618func (this *MemoryStorage) memoryCapacityBytes() int64 {
619 var maxSystemBytes = SharedManager.MaxSystemMemoryBytesPerStorage()
620 if this.policy == nil {
621 return maxSystemBytes
622 }
623
624 if SharedManager.MaxMemoryCapacity != nil {
625 var capacityBytes = SharedManager.MaxMemoryCapacity.Bytes()
626 if capacityBytes > 0 {
627 if capacityBytes > maxSystemBytes {
628 return maxSystemBytes
629 }
630
631 return capacityBytes
632 }
633 }
634
635 var capacity = this.policy.Capacity // copy
636 if capacity != nil {
637 var capacityBytes = capacity.Bytes()
638 if capacityBytes > 0 {
639 if capacityBytes > maxSystemBytes {
640 return maxSystemBytes
641 }
642 return capacityBytes
643 }
644 }
645
646 return maxSystemBytes
647}
648
649func (this *MemoryStorage) deleteWithoutLocker(key string) error {
650 hash := this.hash(key)

Callers 2

openWriterMethod · 0.95

Calls 2

BytesMethod · 0.80

Tested by

no test coverage detected