avoid silly ring buffer logic (faster with -O2, -O3 is always slower then -O2)