Project

General

Profile

Feature #3905 » full-ephemeral-class.diff

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

View differences:

error.c
{
VALUE exc = make_errno_exc(mesg);
rb_extend_object(exc, mod);
FL_SET(CLASS_OF(exc), RCLASS_EPHEMERAL);
rb_exc_raise(exc);
}
......
{
VALUE exc = rb_syserr_new(e, mesg);
rb_extend_object(exc, mod);
FL_SET(CLASS_OF(exc), RCLASS_EPHEMERAL);
rb_exc_raise(exc);
}
ext/openssl/ossl_ssl.c
if (nonblock) {
VALUE exc = ossl_exc_new(eSSLError, "write would block");
rb_extend_object(exc, rb_mWaitWritable);
FL_SET(CLASS_OF(exc), RCLASS_EPHEMERAL);
rb_exc_raise(exc);
}
}
......
if (nonblock) {
VALUE exc = ossl_exc_new(eSSLError, "read would block");
rb_extend_object(exc, rb_mWaitReadable);
FL_SET(CLASS_OF(exc), RCLASS_EPHEMERAL);
rb_exc_raise(exc);
}
}
include/ruby/ruby.h
struct st_table *m_tbl;
struct st_table *iv_index_tbl;
};
#define RCLASS_EPHEMERAL FL_USER1
#define RCLASS_IV_TBL(c) (RCLASS(c)->ptr->iv_tbl)
#define RCLASS_CONST_TBL(c) (RCLASS(c)->ptr->const_tbl)
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
vm_method.c
{
struct cache_entry *ent, *end;
/* ephemeral class does not write to cache */
if (FL_TEST(klass, RCLASS_EPHEMERAL))
return;
rb_vm_change_state();
if (!ruby_running)
......
{
rb_method_entry_t *me = search_method(klass, id);
if (ruby_running) {
if (ruby_running && ! FL_TEST(klass, RCLASS_EPHEMERAL)) {
struct cache_entry *ent;
ent = cache + EXPR1(klass, id);
ent->klass = klass;
(2-2/2)