Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Commit 82da4c4

Browse files
committed
cache: switch to 2q
Due to patent concerns in closed-source downstream products: ipfs/kubo#6590
1 parent 8d6a694 commit 82da4c4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arc_cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ type cacheSize int
1616
// block Cids. This provides block access-time improvements, allowing
1717
// to short-cut many searches without query-ing the underlying datastore.
1818
type arccache struct {
19-
arc *lru.ARCCache
19+
arc *lru.TwoQueueCache
2020
blockstore Blockstore
2121

2222
hits metrics.Counter
2323
total metrics.Counter
2424
}
2525

2626
func newARCCachedBS(ctx context.Context, bs Blockstore, lruSize int) (*arccache, error) {
27-
arc, err := lru.NewARC(lruSize)
27+
arc, err := lru.New2Q(lruSize)
2828
if err != nil {
2929
return nil, err
3030
}

0 commit comments

Comments
 (0)