summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 11:25:44 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 11:25:44 +0000
commit038ef3f05cbddb484c181a8614b088d99014917b (patch)
tree9ced5364385c1e3a5fee3622f0002c6a7d331bef /vm_method.c
parent0f6794cb2329d9abca759a2db2717ea55ba3addf (diff)
* vm_core.h, vm_insnhelper.h: move decl. of
ruby_vm_global_state_version and related macros from vm_core.h to vm_insnhelper.h. * vm.c (vm_clear_all_cache): added. This function is called when ruby_vm_global_state_version overflows. TODO: vm_clear_all_inline_method_cache() is only place holder. We need to implement it ASAP. * vm_method.c (vm_clear_global_method_cache): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vm_method.c b/vm_method.c
index 34fddcc01c..83026d8f33 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -23,6 +23,19 @@ static struct cache_entry cache[CACHE_SIZE];
#define ruby_running (GET_VM()->running)
/* int ruby_running = 0; */
+static void
+vm_clear_global_method_cache(void)
+{
+ struct cache_entry *ent, *end;
+
+ ent = cache;
+ end = ent + CACHE_SIZE;
+ while (ent < end) {
+ ent->filled_version = 0;
+ ent++;
+ }
+}
+
void
rb_clear_cache(void)
{