buffer[idx++] = SBUF;
idx          &= RINGBUFMASK;