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

There are some confusions in the process of reading the source code #65

Open
spemed opened this issue Feb 24, 2022 · 0 comments
Open

There are some confusions in the process of reading the source code #65

spemed opened this issue Feb 24, 2022 · 0 comments

Comments

@spemed
Copy link

spemed commented Feb 24, 2022

    b.gen++
    if b.gen&((1<<genSizeBits)-1) == 0 {
    b.gen++
    }

Hello the developers of fastcache. I am learning how this library running by read the source code.
And i have some confuses when reading the code of function Get() in fastcache.go, line 341.

In my opinion, the field gen in bucket means the reset rounds that the chunk had experienced.
And if gen reach the maximum 1<<genSizeBits it should be reset to 1 and not be gen++.

Is my understanding correct?

@spemed spemed changed the title There is some confusion in the process of reading the source code There are some confusions in the process of reading the source code Feb 25, 2022
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