Closed Akkarinn closed 7 years ago
@Akkarinn Thanks for finding this bug!
What do you think about this solution? https://github.com/rigtorp/MPMCQueue/commit/5bb796fe009ad04c9eae57d0e2289ffb8a7358d1
@rigtorp Your update 5bb796f is better than my proposal :+1:
@Akkarinn I fixed the same bug here: https://github.com/rigtorp/SPSCQueue/commit/97ca6b6b254630093bc52db51cc3063217a26987
If given 'capacity' is < 1 you create a memory leak by throwing after memory allocation since '~MPMCQueue' will not be called. I suggest to move the check in a nested static member function called before 'slots_' initialization.