Skip to content

Commit

Permalink
* vm_method.c: separate clearing cache entry code.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ko1 committed Jul 15, 2009
1 parent 0e03a29 commit d4628c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Thu Jul 16 08:57:44 2009 Koichi Sasada <[email protected]>

* vm_method.c: separate clearing cache entry code.

Thu Jul 16 08:56:32 2009 Koichi Sasada <[email protected]>

* dir.c (push_glob): re-fix GC problem.
Expand Down
12 changes: 8 additions & 4 deletions vm_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ rb_clear_cache(void)
ent = cache;
end = ent + CACHE_SIZE;
while (ent < end) {
ent->me = ent->mid = 0;
ent->me = 0;
ent->mid = 0;
ent++;
}
}
Expand All @@ -52,7 +53,8 @@ rb_clear_cache_for_undef(VALUE klass, ID id)
end = ent + CACHE_SIZE;
while (ent < end) {
if ((ent->me && ent->me->klass == klass) && ent->mid == id) {
ent->me = ent->mid = 0;
ent->me = 0;
ent->mid = 0;
}
ent++;
}
Expand All @@ -71,7 +73,8 @@ rb_clear_cache_by_id(ID id)
end = ent + CACHE_SIZE;
while (ent < end) {
if (ent->mid == id) {
ent->me = ent->mid = 0;
ent->me = 0;
ent->mid = 0;
}
ent++;
}
Expand All @@ -90,7 +93,8 @@ rb_clear_cache_by_class(VALUE klass)
end = ent + CACHE_SIZE;
while (ent < end) {
if (ent->klass == klass || (ent->me && ent->me->klass == klass)) {
ent->me = ent->mid = 0;
ent->me = 0;
ent->mid = 0;
}
ent++;
}
Expand Down

0 comments on commit d4628c0

Please sign in to comment.