* eval.c (rb_eval): need not to clar method cache for NODE_CLASS,
NODE_SCLASS. * gc.c (obj_free): need not to clear method cache on class/module finalization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e664d467a9
commit
d102ce6d09
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
Sat Jan 19 02:31:45 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_eval): need not to clar method cache for NODE_CLASS,
|
||||||
|
NODE_SCLASS.
|
||||||
|
|
||||||
|
* gc.c (obj_free): need not to clear method cache on class/module
|
||||||
|
finalization.
|
||||||
|
|
||||||
|
Fri Jan 18 23:38:03 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* array.c (rb_ary_fetch): index out of range raises exception
|
||||||
|
unless optional second argument is specified.
|
||||||
|
|
||||||
Fri Jan 18 17:32:09 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Fri Jan 18 17:32:09 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (rb_io_s_new): block check moved from initialize to this
|
* io.c (rb_io_s_new): block check moved from initialize to this
|
||||||
|
1
ToDo
1
ToDo
@ -34,6 +34,7 @@ Language Spec.
|
|||||||
* "in" modifier, to annotate, or to encourage assertion.
|
* "in" modifier, to annotate, or to encourage assertion.
|
||||||
* selector namespace - something like generic-flet in CLOS, to help RubyBehevior
|
* selector namespace - something like generic-flet in CLOS, to help RubyBehevior
|
||||||
* private instance variable (as in Python?) @_foo in class Foo => @_Foo_foo
|
* private instance variable (as in Python?) @_foo in class Foo => @_Foo_foo
|
||||||
|
* warn/error "bare word" method, like "foo", you should type "foo()"
|
||||||
|
|
||||||
Hacking Interpreter
|
Hacking Interpreter
|
||||||
|
|
||||||
|
3
array.c
3
array.c
@ -550,7 +550,8 @@ rb_ary_fetch(argc, argv, ary)
|
|||||||
idx += RARRAY(ary)->len;
|
idx += RARRAY(ary)->len;
|
||||||
}
|
}
|
||||||
if (idx < 0 || RARRAY(ary)->len <= idx) {
|
if (idx < 0 || RARRAY(ary)->len <= idx) {
|
||||||
return ifnone;
|
if (argc == 2) return ifnone;
|
||||||
|
rb_raise(rb_eIndexError, "index %d out of array", idx);
|
||||||
}
|
}
|
||||||
return RARRAY(ary)->ptr[idx];
|
return RARRAY(ary)->ptr[idx];
|
||||||
}
|
}
|
||||||
|
6
eval.c
6
eval.c
@ -190,7 +190,7 @@ static struct cache_entry cache[CACHE_SIZE];
|
|||||||
void
|
void
|
||||||
rb_clear_cache()
|
rb_clear_cache()
|
||||||
{
|
{
|
||||||
struct cache_entry *ent, *end;
|
struct cache_entry *ent, *end;
|
||||||
|
|
||||||
ent = cache; end = ent + CACHE_SIZE;
|
ent = cache; end = ent + CACHE_SIZE;
|
||||||
while (ent < end) {
|
while (ent < end) {
|
||||||
@ -3239,7 +3239,6 @@ rb_eval(self, n)
|
|||||||
if (rb_safe_level() >= 4) {
|
if (rb_safe_level() >= 4) {
|
||||||
rb_raise(rb_eSecurityError, "extending class prohibited");
|
rb_raise(rb_eSecurityError, "extending class prohibited");
|
||||||
}
|
}
|
||||||
rb_clear_cache();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
override_class:
|
override_class:
|
||||||
@ -3306,9 +3305,6 @@ rb_eval(self, n)
|
|||||||
}
|
}
|
||||||
if (rb_safe_level() >= 4 && !OBJ_TAINTED(klass))
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(klass))
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't extend object");
|
rb_raise(rb_eSecurityError, "Insecure: can't extend object");
|
||||||
if (FL_TEST(CLASS_OF(klass), FL_SINGLETON)) {
|
|
||||||
rb_clear_cache();
|
|
||||||
}
|
|
||||||
klass = rb_singleton_class(klass);
|
klass = rb_singleton_class(klass);
|
||||||
|
|
||||||
if (ruby_wrapper) {
|
if (ruby_wrapper) {
|
||||||
|
@ -1362,7 +1362,7 @@ static VALUE
|
|||||||
unix_svr_init(sock, path)
|
unix_svr_init(sock, path)
|
||||||
VALUE sock, path;
|
VALUE sock, path;
|
||||||
{
|
{
|
||||||
return open_unix(sock, path, 1);
|
return init_unixsock(sock, path, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
@ -1557,7 +1557,8 @@ sock_s_socketpair(klass, domain, type, protocol)
|
|||||||
rb_sys_fail("socketpair(2)");
|
rb_sys_fail("socketpair(2)");
|
||||||
}
|
}
|
||||||
|
|
||||||
return rb_assoc_new(sock_new(klass, sp[0]), sock_new(klass, sp[1]));
|
return rb_assoc_new(init_sock(rb_obj_alloc(klass), sp[0]),
|
||||||
|
init_sock(rb_obj_alloc(klass), sp[1]));
|
||||||
#else
|
#else
|
||||||
rb_notimplement();
|
rb_notimplement();
|
||||||
#endif
|
#endif
|
||||||
|
1
gc.c
1
gc.c
@ -941,7 +941,6 @@ obj_free(obj)
|
|||||||
break;
|
break;
|
||||||
case T_MODULE:
|
case T_MODULE:
|
||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
rb_clear_cache();
|
|
||||||
st_free_table(RANY(obj)->as.klass.m_tbl);
|
st_free_table(RANY(obj)->as.klass.m_tbl);
|
||||||
if (RANY(obj)->as.object.iv_tbl) {
|
if (RANY(obj)->as.object.iv_tbl) {
|
||||||
st_free_table(RANY(obj)->as.object.iv_tbl);
|
st_free_table(RANY(obj)->as.object.iv_tbl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user