There is a specific circular buffer I wish to keep hot in cache, however it can go unused for extended periods of time. This is causing cache misses.
I have an idle loop that can take responsibility for keeping the location hot, but I cannot see a way to do this using only the public interface without actually inserting/removing items.
Is there any action, using the public interface, that when the circular buffer is empty, will keep the insertion point hot in cache?
You may like to warm up your full fast path periodically by executing it in full and stopping as short from committing the effects of it as possible.
If you can get hold of a pointer to the front of the container you can use
__builtin_prefetchon it to bring it into the cache. Alternatively,pushandpopan element.