Project

General

Profile

Feature #3905 ยป full-ephemeral-class.diff

full diff - normalperson (Eric Wong), 05/18/2011 02:59 AM

View differences:

error.c
1597 1597
{
1598 1598
    VALUE exc = make_errno_exc(mesg);
1599 1599
    rb_extend_object(exc, mod);
1600
    FL_SET(CLASS_OF(exc), RCLASS_EPHEMERAL);
1600 1601
    rb_exc_raise(exc);
1601 1602
}
1602 1603

  
......
1605 1606
{
1606 1607
    VALUE exc = rb_syserr_new(e, mesg);
1607 1608
    rb_extend_object(exc, mod);
1609
    FL_SET(CLASS_OF(exc), RCLASS_EPHEMERAL);
1608 1610
    rb_exc_raise(exc);
1609 1611
}
1610 1612

  
ext/openssl/ossl_ssl.c
1076 1076
    if (nonblock) {
1077 1077
        VALUE exc = ossl_exc_new(eSSLError, "write would block");
1078 1078
        rb_extend_object(exc, rb_mWaitWritable);
1079
        FL_SET(CLASS_OF(exc), RCLASS_EPHEMERAL);
1079 1080
        rb_exc_raise(exc);
1080 1081
    }
1081 1082
}
......
1086 1087
    if (nonblock) {
1087 1088
        VALUE exc = ossl_exc_new(eSSLError, "read would block");
1088 1089
        rb_extend_object(exc, rb_mWaitReadable);
1090
        FL_SET(CLASS_OF(exc), RCLASS_EPHEMERAL);
1089 1091
        rb_exc_raise(exc);
1090 1092
    }
1091 1093
}
include/ruby/ruby.h
621 621
    struct st_table *m_tbl;
622 622
    struct st_table *iv_index_tbl;
623 623
};
624
#define RCLASS_EPHEMERAL FL_USER1
624 625
#define RCLASS_IV_TBL(c) (RCLASS(c)->ptr->iv_tbl)
625 626
#define RCLASS_CONST_TBL(c) (RCLASS(c)->ptr->const_tbl)
626 627
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
vm_method.c
85 85
{
86 86
    struct cache_entry *ent, *end;
87 87

  
88
    /* ephemeral class does not write to cache */
89
    if (FL_TEST(klass, RCLASS_EPHEMERAL))
90
	return;
91

  
88 92
    rb_vm_change_state();
89 93

  
90 94
    if (!ruby_running)
......
417 421
{
418 422
    rb_method_entry_t *me = search_method(klass, id);
419 423

  
420
    if (ruby_running) {
424
    if (ruby_running && ! FL_TEST(klass, RCLASS_EPHEMERAL)) {
421 425
	struct cache_entry *ent;
426

  
422 427
	ent = cache + EXPR1(klass, id);
423 428
	ent->klass = klass;
424 429