From ecebbcce1f58687bdcc1028bc8813f004bc22427 Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 2 Mar 2006 05:22:30 +0000 Subject: * gc.c: align VALUE with sizeof(RVALUE) globally. (is_pointer_to_heap): check alignment out of loop. (id2ref): avoid collision between symbols and objects. (rb_obj_id): ditto. moved from object.c. [ruby-talk:178364] [ruby-core:7401] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'object.c') diff --git a/object.c b/object.c index 233b9ee131..e3102acc2b 100644 --- a/object.c +++ b/object.c @@ -95,45 +95,6 @@ rb_obj_equal(VALUE obj1, VALUE obj2) return Qfalse; } - -/* - * Document-method: __id__ - * Document-method: object_id - * - * call-seq: - * obj.__id__ => fixnum - * obj.object_id => fixnum - * - * Returns an integer identifier for obj. The same number will - * be returned on all calls to id for a given object, and - * no two active objects will share an id. - * Object#object_id is a different concept from the - * :name notation, which returns the symbol id of - * name. Replaces the deprecated Object#id. - */ - - - -/* - * call-seq: - * obj.hash => fixnum - * - * Generates a Fixnum hash value for this object. This - * function must have the property that a.eql?(b) implies - * a.hash == b.hash. The hash value is used by class - * Hash. Any hash value that exceeds the capacity of a - * Fixnum will be truncated before being used. - */ - -VALUE -rb_obj_id(VALUE obj) -{ - if (SPECIAL_CONST_P(obj)) { - return LONG2NUM((long)obj); - } - return (VALUE)((long)obj|FIXNUM_FLAG); -} - VALUE rb_class_real(VALUE cl) { @@ -2418,9 +2379,6 @@ Init_Object(void) rb_define_method(rb_mKernel, "eql?", rb_obj_equal, 1); - rb_define_method(rb_mKernel, "hash", rb_obj_id, 0); - rb_define_method(rb_mKernel, "__id__", rb_obj_id, 0); - rb_define_method(rb_mKernel, "object_id", rb_obj_id, 0); rb_define_method(rb_mKernel, "class", rb_obj_class, 0); rb_define_method(rb_mKernel, "clone", rb_obj_clone, 0); -- cgit v1.2.3