示例#1
0
文件: vm_method.c 项目: genki/ruby
void
rb_clear_cache(void)
{
    struct cache_entry *ent, *end;

    rb_vm_change_state();

    if (!ruby_running)
	return;
    ent = cache;
    end = ent + CACHE_SIZE;
    while (ent < end) {
	ent->mid = 0;
	ent++;
    }
}
示例#2
0
文件: vm_method.c 项目: genki/ruby
void
rb_clear_cache_by_class(VALUE klass)
{
    struct cache_entry *ent, *end;

    rb_vm_change_state();

    if (!ruby_running)
	return;
    ent = cache;
    end = ent + CACHE_SIZE;
    while (ent < end) {
	if (ent->klass == klass || ent->oklass == klass) {
	    ent->mid = 0;
	}
	ent++;
    }
}
示例#3
0
文件: vm_method.c 项目: genki/ruby
static void
rb_clear_cache_for_undef(VALUE klass, ID id)
{
    struct cache_entry *ent, *end;

    rb_vm_change_state();

    if (!ruby_running)
	return;
    ent = cache;
    end = ent + CACHE_SIZE;
    while (ent < end) {
	if (ent->oklass == klass && ent->mid == id) {
	    ent->mid = 0;
	}
	ent++;
    }
}
void
rb_clear_cache_by_class(VALUE klass)
{
    rb_vm_change_state();
}
static void
rb_clear_cache_by_id(ID id)
{
    rb_vm_change_state();
}
static void
rb_clear_cache_for_undef(VALUE klass, ID id)
{
    rb_vm_change_state();
}
void
rb_clear_cache(void)
{
    rb_vm_change_state();
}