diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-11-15 20:42:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-15 20:42:19 +0800 |
commit | 17d67c5834679f2b27ef08eddfce3b3a154a96a8 (patch) | |
tree | 3989575655db27f02641bf1fc7d96f87a9441ebb /vendor/github.com/allegro/bigcache/utils.go | |
parent | 14346e4ef97ca812fb9f1d5d2cd87021c0155cf6 (diff) | |
parent | 434dd5bc0067cdf604d84426df9086015721dd36 (diff) | |
download | go-tangerine-17d67c5834679f2b27ef08eddfce3b3a154a96a8.tar go-tangerine-17d67c5834679f2b27ef08eddfce3b3a154a96a8.tar.gz go-tangerine-17d67c5834679f2b27ef08eddfce3b3a154a96a8.tar.bz2 go-tangerine-17d67c5834679f2b27ef08eddfce3b3a154a96a8.tar.lz go-tangerine-17d67c5834679f2b27ef08eddfce3b3a154a96a8.tar.xz go-tangerine-17d67c5834679f2b27ef08eddfce3b3a154a96a8.tar.zst go-tangerine-17d67c5834679f2b27ef08eddfce3b3a154a96a8.zip |
Merge pull request #18087 from karalabe/trie-read-cacher
cmd, core, eth, light, trie: add trie read caching layer
Diffstat (limited to 'vendor/github.com/allegro/bigcache/utils.go')
-rw-r--r-- | vendor/github.com/allegro/bigcache/utils.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/github.com/allegro/bigcache/utils.go b/vendor/github.com/allegro/bigcache/utils.go new file mode 100644 index 000000000..ca1df79b9 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/utils.go @@ -0,0 +1,16 @@ +package bigcache + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func convertMBToBytes(value int) int { + return value * 1024 * 1024 +} + +func isPowerOfTwo(number int) bool { + return (number & (number - 1)) == 0 +} |