aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 31ef216027..1b352937fe 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -208,4 +208,13 @@ extern VALUE ruby_vm_const_missing_count;
#endif
+static VALUE ruby_vm_global_state_version = 1;
+
+#define GET_VM_STATE_VERSION() (ruby_vm_global_state_version)
+#define INC_VM_STATE_VERSION() do { \
+ ruby_vm_global_state_version = (ruby_vm_global_state_version + 1); \
+ if (ruby_vm_global_state_version == 0) vm_clear_all_cache(); \
+} while (0)
+static void vm_clear_all_cache(void);
+
#endif /* RUBY_INSNHELPER_H */