A simple, fast circular buffer implementation