I remember that we encountered the same problem recently in the context of the Javascript JIT compiler of the Chromium engine [1]. Since there exists no POSIX API for the instruction-cache invalidation, we decided to add a new public interface to the libc [2].
[1] https://github.com/genodelabs/genode/issues/3858 [2] https://github.com/genodelabs/genode/blob/master/repos/libports/include/libc...
Wow , thanks. My code runs 10x faster now. I have a lot of optimisations to do, but happy so far.
Michael