fix? ringbuffer [makes it unusable with valgrind when using T=std::function though]