-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: add Cap interface{} #145
Conversation
arc/arc.go
Outdated
@@ -202,6 +202,11 @@ func (c *ARCCache[K, V]) Len() int { | |||
return c.t1.Len() + c.t2.Len() | |||
} | |||
|
|||
// Cap returns the capacity of cache | |||
func (c *ARCCache[K, V]) Cap() int { | |||
return c.Cap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This results in an infinite recursive call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This results in an infinite recursive call.
Thank for your reviewing, I have fix it
@zhuliquan can you update this PR to resolve the conflicts. Once that is done, I will merge it. Sorry for the delay. |
Yes, I have resolved |
Your branch still has conflicts. Can you rebase off of main instead of doing a merge from main? |
I'am very confused, all tests is ok before. Three are some cases is wrong, when I rung
|
I don't get those errors when I run the tests |
Case (TestLRUWithPurge) isn't ok until I add more wait time (i.g. 2000 * time.Millisecond). are there some bugs in expire operation? golang-lru/expirable/expirable_lru_test.go Line 247 in d582c45
|
add
Cap
func for getting the capacity of the cache. it's helpful for computing usage ratio of cache