Revision: 3920 http://trac.macosforge.org/projects/ruby/changeset/3920 Author: lsansonetti@apple.com Date: 2010-04-12 18:08:15 -0700 (Mon, 12 Apr 2010) Log Message: ----------- better ignored sel detection Modified Paths: -------------- MacRuby/trunk/id.c MacRuby/trunk/id.h MacRuby/trunk/objc.h MacRuby/trunk/objc.m MacRuby/trunk/vm.cpp Modified: MacRuby/trunk/id.c =================================================================== --- MacRuby/trunk/id.c 2010-04-12 21:34:42 UTC (rev 3919) +++ MacRuby/trunk/id.c 2010-04-13 01:08:15 UTC (rev 3920) @@ -76,8 +76,6 @@ selMethodMissing = sel_registerName("method_missing:"); selCopy = sel_registerName("copy"); selMutableCopy = sel_registerName("mutableCopy"); - sel_ignored = sel_registerName("retain"); - assert(sel_ignored == sel_registerName("release")); sel_zone = sel_registerName("zone"); selToS = sel_registerName("to_s"); selToAry = sel_registerName("to_ary"); Modified: MacRuby/trunk/id.h =================================================================== --- MacRuby/trunk/id.h 2010-04-12 21:34:42 UTC (rev 3919) +++ MacRuby/trunk/id.h 2010-04-13 01:08:15 UTC (rev 3920) @@ -88,7 +88,6 @@ extern SEL selMutableCopy; extern SEL selToS; extern SEL selToAry; -extern SEL sel_ignored; extern SEL sel_zone; extern SEL selSend; extern SEL sel__send__; Modified: MacRuby/trunk/objc.h =================================================================== --- MacRuby/trunk/objc.h 2010-04-12 21:34:42 UTC (rev 3919) +++ MacRuby/trunk/objc.h 2010-04-13 01:08:15 UTC (rev 3920) @@ -233,6 +233,8 @@ void rb_objc_exception_raise(const char *name, const char *message); +bool rb_objc_ignore_sel(SEL sel); + #if defined(__cplusplus) } #endif Modified: MacRuby/trunk/objc.m =================================================================== --- MacRuby/trunk/objc.m 2010-04-12 21:34:42 UTC (rev 3919) +++ MacRuby/trunk/objc.m 2010-04-13 01:08:15 UTC (rev 3920) @@ -635,6 +635,16 @@ reason:[NSString stringWithUTF8String:message] userInfo:nil] raise]; } +bool +rb_objc_ignore_sel(SEL sel) +{ + return sel == @selector(retain) + || sel == @selector(release) + || sel == @selector(autorelease) + || sel == @selector(retainCount) + || sel == @selector(dealloc); +} + size_t rb_objc_type_size(const char *type) { Modified: MacRuby/trunk/vm.cpp =================================================================== --- MacRuby/trunk/vm.cpp 2010-04-12 21:34:42 UTC (rev 3919) +++ MacRuby/trunk/vm.cpp 2010-04-13 01:08:15 UTC (rev 3920) @@ -2115,7 +2115,7 @@ flags |= VM_METHOD_PROTECTED; } - if (sel == sel_ignored) { + if (rb_objc_ignore_sel(sel)) { // TODO return; } @@ -2236,7 +2236,7 @@ static void push_method(VALUE ary, SEL sel, int flags, int (*filter) (VALUE, ID, VALUE)) { - if (sel == sel_ignored) { + if (rb_objc_ignore_sel(sel)) { return; } @@ -2560,7 +2560,7 @@ { assert(klass != NULL); - if (sel == sel_ignored) { + if (rb_objc_ignore_sel(sel)) { // TODO return NULL; }
participants (1)
-
source_changes@macosforge.org