bounded-spsc-queue
bounded-spsc-queue copied to clipboard
Don't panic on OOM allocation
trafficstars
Currently, if you try to request too much memory for the queue and allocation fails, we throw an OOM panic. That's pretty unfriendly :)
Instead, we should return a Result with the proper error so the user can decide what to do.
Hi,
I ran into a similar issue, but on the other side of the allocation size ;)
If you want to send an empty struct across the queue, it dies with a memory allocation of 0 bytes failedAbort trap: 6. While this might not be a good use case, I think returning a result and telling the user rather than panicking might be better.