We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
测试代码:
var c = ecache.NewLRUCache(16, 65535, 100*time.Millisecond) func BenchmarkName(b *testing.B) { for i := 0; i < b.N; i++ { c.Put("key", "value") } }
报错如下
goos: darwin goarch: amd64 pkg: mongoTest cpu: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz BenchmarkName panic: runtime error: index out of range [0] with length 0 goroutine 24 [running]: github.com/orca-zhang/ecache.(*cache).put(0xc000090300, {0x1460fa8, 0x191c108}, 0xc0000a0230, {0x0, 0x0, 0x0}, 0x16ce5d9127de9770, 0x1481be8) /pkg/mod/github.com/orca-zhang/ecache@v1.1.0/ecache.go:84 +0x6b6 github.com/orca-zhang/ecache.(*Cache).put(0xc000180050, {0x1460fa8, 0x1}, 0x392c0068000c1ee8, {0x0, 0x0, 0x0}) /pkg/mod/github.com/orca-zhang/ecache@v1.1.0/ecache.go:165 +0x129 github.com/orca-zhang/ecache.(*Cache).Put(...) /pkg/mod/github.com/orca-zhang/ecache@v1.1.0/ecache.go:179 mongoTest.BenchmarkName(0xc000168000) /mongoTest/lrucache_test.go:12 +0x9b
看样子只要容量设置为65535,就会触发越界panic
The text was updated successfully, but these errors were encountered:
感谢反馈,看上去是
ecache/ecache.go
Line 60 in 0b78577
uint32
Sorry, something went wrong.
4dddf1a 添加用例复现 8c25851 已修复
No branches or pull requests
测试代码:
报错如下
看样子只要容量设置为65535,就会触发越界panic
The text was updated successfully, but these errors were encountered: