You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I think would be really wonderful would be if Allocate is called with a size bigger than maxSize, it should just make it and return it, never returning it to the pool (and obviously never looking for it in the pool).
I have an app that needs to buffer requests, most of which are a few MB, but occasionally one is a GB or more. I don't want to set maxSize so large and allow a GB buffer to go back on the pool, but it would be great if I could set maxSize to 10MB, let most of the requests be served by the pool, and take the occasional GC hit when a giant one comes along.
If you don't like this idea, then it would be nice to make maxSize public or add a getter for it, so that I can do an if size > pool.MaxSize in my own code without having to store the max size separately. The last thing I want is to have to recover from a panic.
The text was updated successfully, but these errors were encountered:
Thank you for the use case. Much of why it is a panic is that I couldn't figure out what the use case would be.
It seems to me the correct answer is both; it should be accessible, and it should go ahead and make larger buffers and return them without tracking. I'll get that in the next day or two. (Or you can submit a fix, if you've got one in hand. No pressure, just if you already have one.)
What I think would be really wonderful would be if
Allocate
is called with a size bigger thanmaxSize
, it should justmake
it and return it, never returning it to the pool (and obviously never looking for it in the pool).I have an app that needs to buffer requests, most of which are a few MB, but occasionally one is a GB or more. I don't want to set
maxSize
so large and allow a GB buffer to go back on the pool, but it would be great if I could setmaxSize
to 10MB, let most of the requests be served by the pool, and take the occasional GC hit when a giant one comes along.If you don't like this idea, then it would be nice to make
maxSize
public or add a getter for it, so that I can do anif size > pool.MaxSize
in my own code without having to store the max size separately. The last thing I want is to have to recover from a panic.The text was updated successfully, but these errors were encountered: