summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2022-07-22 12:21:19 -0400
committerTakashi Kokubun <takashikkbn@gmail.com>2022-08-29 08:47:03 -0700
commit4024553d131012c313d08b4939f3596b6044c077 (patch)
tree375a7c54ac6ede6f86676a315e833a207fbb3578
parent7e22ec7439211d43aea850a4e849f37e631ed131 (diff)
Add ifdef to clear cache
-rw-r--r--yjit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/yjit.c b/yjit.c
index a0c5c09091..584f909473 100644
--- a/yjit.c
+++ b/yjit.c
@@ -81,7 +81,9 @@ rb_yjit_mark_executable(void *mem_block, uint32_t mem_size)
// Clear/invalidate the instruction cache. Compiles to nothing on x86_64
// but required on ARM. On Darwin it's the same as calling sys_icache_invalidate().
+#ifdef __GNUC__
__builtin___clear_cache(mem_block, (char *)mem_block + mem_size);
+#endif
}
# define PTR2NUM(x) (rb_int2inum((intptr_t)(void *)(x)))