padenot / ringbuf.js

Wait-free thread-safe single-consumer single-producer ring buffer using SharedArrayBuffer
https://ringbuf-js.netlify.app/
Mozilla Public License 2.0
201 stars 18 forks source link

Fix pop not working with small reads #8

Closed thedjinn closed 3 years ago

thedjinn commented 3 years ago

This fixes pop() so that it will properly read from the beginning of the SAB when using an output buffer that is smaller than the ring buffer capacity.

padenot commented 3 years ago

Thanks a lot. This clearly tells me that I should have written tests for this, and I haven't. I'll get on it.