Skip to content

Commit

Permalink
Force cache size truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda committed Nov 28, 2018
1 parent 7ef38b2 commit 810d326
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion balloon/balloon.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Balloon struct {
func NewBalloon(store storage.Store, hasherF func() hashing.Hasher) (*Balloon, error) {

// create caches
hyperCache := cache.NewFreeCache(hyper.CacheSize)
hyperCache := cache.NewFreeCache(int(hyper.CacheSize))

// create trees
historyTree := history.NewHistoryTree(hasherF, store, 30)
Expand Down
2 changes: 1 addition & 1 deletion balloon/hyper/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
)

const (
CacheSize int = (1 << 26) * 68 // 2^26 elements * 68 bytes for entry
CacheSize int64 = (1 << 26) * 68 // 2^26 elements * 68 bytes for entry
)

type HyperTree struct {
Expand Down
2 changes: 1 addition & 1 deletion balloon/hyper/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func BenchmarkAdd(b *testing.B) {
defer closeF()

hasher := hashing.NewSha256Hasher()
freeCache := cache.NewFreeCache(CacheSize)
freeCache := cache.NewFreeCache(int(CacheSize))
tree := NewHyperTree(hashing.NewSha256Hasher, store, freeCache)

b.ResetTimer()
Expand Down

0 comments on commit 810d326

Please sign in to comment.