Custom Implementation Of Cyclic Buffer