aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/allegro/bigcache/bytes.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/bytes.go
parent9a000601c6c4e4f8134caedba1957ffe28d2b659 (diff)
downloadgo-tangerine-434dd5bc0067cdf604d84426df9086015721dd36.tar
go-tangerine-434dd5bc0067cdf604d84426df9086015721dd36.tar.gz
go-tangerine-434dd5bc0067cdf604d84426df9086015721dd36.tar.bz2
go-tangerine-434dd5bc0067cdf604d84426df9086015721dd36.tar.lz
go-tangerine-434dd5bc0067cdf604d84426df9086015721dd36.tar.xz
go-tangerine-434dd5bc0067cdf604d84426df9086015721dd36.tar.zst
go-tangerine-434dd5bc0067cdf604d84426df9086015721dd36.zip
cmd, core, eth, light, trie: add trie read caching layer
Diffstat (limited to 'vendor/github.com/allegro/bigcache/bytes.go')
-rw-r--r--vendor/github.com/allegro/bigcache/bytes.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/github.com/allegro/bigcache/bytes.go b/vendor/github.com/allegro/bigcache/bytes.go
new file mode 100644
index 000000000..3944bfe13
--- /dev/null
+++ b/vendor/github.com/allegro/bigcache/bytes.go
@@ -0,0 +1,14 @@
+// +build !appengine
+
+package bigcache
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+func bytesToString(b []byte) string {
+ bytesHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))
+ strHeader := reflect.StringHeader{Data: bytesHeader.Data, Len: bytesHeader.Len}
+ return *(*string)(unsafe.Pointer(&strHeader))
+}