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

can remove the CacheTable #36

Closed
wants to merge 3 commits into from
Closed

can remove the CacheTable #36

wants to merge 3 commits into from

Conversation

smallnest
Copy link

we also flush before remove it

cache.go Outdated
// since we remove it, its cache is unnecessary ao we flush it.
cacheTable := cache[table]
if cacheTable != nil {
cacheTable.Flush()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is flushing really necessary here? If we drop the last reference to the table, the GC should clean up those values for us.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It should be unnecessary. I remember it is trick for java that can release those objects as early as possible, but I think it should be unnecessary for go.

@coveralls
Copy link

coveralls commented Jul 31, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 1b61c87 on smallnest:master into 5eb7935 on muesli:master.

@muesli
Copy link
Owner

muesli commented Jul 31, 2019

@smallnest Careful, you keep pushing more commits to this branch, with seemingly unrelated changes. Please keep PRs & commits as granular as possible, so it's easier to review & merge them.

@smallnest smallnest closed this Jul 31, 2019
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

Successfully merging this pull request may close these issues.

3 participants