Skip to content
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

EvictSomeItems does not count leaf node in numEvicted #14

Open
starius opened this issue Mar 19, 2017 · 1 comment
Open

EvictSomeItems does not count leaf node in numEvicted #14

starius opened this issue Mar 19, 2017 · 1 comment

Comments

@starius
Copy link

starius commented Mar 19, 2017

If I understand correctly, how it works, it should be:

diff --git a/collection.go b/collection.go
index 6e92191..1a91b0c 100644
--- a/collection.go
+++ b/collection.go
@@ -245,6 +245,7 @@ func (t *Collection) EvictSomeItems() (numEvicted uint64) {
        })
        if i != nil && err != nil {
                t.store.ItemDecRef(t, i)
+               numEvicted++
        }
        return numEvicted
 }
@starius
Copy link
Author

starius commented Mar 19, 2017

Hmm, I am not sure that this is correct. The actual eviction happens in CompareAndSwapPointer, not in ItemDecRef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant