[macruby-changes] [3061] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Sun Nov 29 21:24:54 PST 2009


Revision: 3061
          http://trac.macosforge.org/projects/ruby/changeset/3061
Author:   lsansonetti at apple.com
Date:     2009-11-29 21:24:50 -0800 (Sun, 29 Nov 2009)
Log Message:
-----------
don't touch -[NSObject hash]

Modified Paths:
--------------
    MacRuby/trunk/class.c
    MacRuby/trunk/gc.c
    MacRuby/trunk/include/ruby/intern.h

Modified: MacRuby/trunk/class.c
===================================================================
--- MacRuby/trunk/class.c	2009-11-30 03:18:46 UTC (rev 3060)
+++ MacRuby/trunk/class.c	2009-11-30 05:24:50 UTC (rev 3061)
@@ -129,6 +129,7 @@
     rb_objc_define_private_method(klass, "initialize", rb_objc_init, 0);
     rb_objc_define_private_method(klass, "initialize_copy",
 	    rb_obj_init_copy, 1);
+    rb_objc_define_method(klass, "hash", rb_obj_id, 0);
 
     // To make sure singleton classes will be filtered.
     rb_objc_define_method(klass, "class", rb_obj_class, 0);

Modified: MacRuby/trunk/gc.c
===================================================================
--- MacRuby/trunk/gc.c	2009-11-30 03:18:46 UTC (rev 3060)
+++ MacRuby/trunk/gc.c	2009-11-30 05:24:50 UTC (rev 3061)
@@ -732,8 +732,6 @@
 
 static IMP rb_objc_finalizer_finalize_super = NULL;
 
-static VALUE rb_obj_id(VALUE obj, SEL sel);
-
 static void
 rb_objc_finalizer_finalize(void *rcv, SEL sel)
 {
@@ -886,7 +884,7 @@
  *  <code>Fixnum</code> will be truncated before being used.
  */
 
-static VALUE
+VALUE
 rb_obj_id(VALUE obj, SEL sel)
 {
     return (VALUE)LONG2NUM((SIGNED_VALUE)obj);
@@ -1078,7 +1076,6 @@
     rb_global_variable(&nomem_error);
     nomem_error = rb_exc_new2(rb_eNoMemError, "failed to allocate memory");
 
-    rb_objc_define_method(rb_mKernel, "hash", rb_obj_id, 0);
     rb_objc_define_method(rb_mKernel, "__id__", rb_obj_id, 0);
     rb_objc_define_method(rb_mKernel, "object_id", rb_obj_id, 0);
 

Modified: MacRuby/trunk/include/ruby/intern.h
===================================================================
--- MacRuby/trunk/include/ruby/intern.h	2009-11-30 03:18:46 UTC (rev 3060)
+++ MacRuby/trunk/include/ruby/intern.h	2009-11-30 05:24:50 UTC (rev 3061)
@@ -324,6 +324,7 @@
 char *rb_path_end(const char *);
 VALUE rb_file_directory_p(VALUE,SEL,VALUE);
 /* gc.c */
+VALUE rb_obj_id(VALUE obj, SEL sel);
 void ruby_set_stack_size(size_t);
 NORETURN(void rb_memerror(void));
 int ruby_stack_check(void);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091129/2126f120/attachment-0001.html>


More information about the macruby-changes mailing list