Exemple #1
0
// Using this constructor is almost always wrong. Use NewMultiLRUCache instead.
func (m *MultiLRUCache) Init(buckets, bucket_capacity uint) {
	m.buckets = buckets
	m.cache = make([]*lrucache.LRUCache, buckets)
	for i := uint(0); i < buckets; i++ {
		m.cache[i] = lrucache.NewLRUCache(bucket_capacity)
	}
}
Exemple #2
0
func makeLRUCache(capacity uint64) mcache.Cache {
	return lrucache.NewLRUCache(uint(capacity))
}