aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/allegro/bigcache/utils.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-11-13 00:47:34 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-11-15 18:22:13 +0800
commit434dd5bc0067cdf604d84426df9086015721dd36 (patch)
tree279d85e32a36b8804d60c5a4b83b444514850782 /vendor/github.com/allegro/bigcache/utils.go
parent9a000601c6c4e4f8134caedba1957ffe28d2b659 (diff)
downloaddexon-434dd5bc0067cdf604d84426df9086015721dd36.tar.gz
dexon-434dd5bc0067cdf604d84426df9086015721dd36.tar.zst
dexon-434dd5bc0067cdf604d84426df9086015721dd36.zip
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.go16
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
+}