()
| 616 | } |
| 617 | |
| 618 | func (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 | |
| 649 | func (this *MemoryStorage) deleteWithoutLocker(key string) error { |
| 650 | hash := this.hash(key) |
no test coverage detected