For in-order queues, a simple solution would be holding a reference to the queue that was last used to operate on the SVM, and using that to enqueue_release when it goes out of scope.
For out-of-order queues, we could hold on to a bounded number of events, waiting on the ones that get booted out.
(Normal
Buffer
s do that implicitly.)enqueue_release
when it goes out of scope.