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

No exported method to free reader #179

Open
shabbyrobe opened this issue May 29, 2017 · 3 comments
Open

No exported method to free reader #179

shabbyrobe opened this issue May 29, 2017 · 3 comments

Comments

@shabbyrobe
Copy link
Contributor

If you create a msgp Reader using msgp.NewReader(), it will acquire a reader from the readerPool but there's no way to return it - freeR() is unexported, as is the pool.

@peterbourgon
Copy link

peterbourgon commented Mar 25, 2020

This is a major bug! Can this get some attention?

NewReader should not be used in any circumstance until this is fixed...

@philhofer
Copy link
Member

@peterbourgon I don't see how this is a "major bug;" it looks like a missing optimization at worst.
The pool doesn't retain a reference to the reader, so it is simply GC'd as normal, unless you've noticed something that I haven't.

@peterbourgon
Copy link

peterbourgon commented Mar 25, 2020

You're right, I mis-remembered how sync.Pool worked; I thought it retained references to leased objects. Forgive the alarm. I still believe this is a major bug.

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

3 participants