Issue #7449 has been updated by zzak (Zachary Scott).


eric, you mean Fixnum right?

Or change rb_obj_id implementation to return INT2NUM((SIGNED_VALUE)obj);
----------------------------------------
Bug #7449: Rdoc for obj.object_id
https://bugs.ruby-lang.org/issues/7449#change-34096

Author: phasis68 (Heesob Park)
Status: Assigned
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-27 trunk 37869) [x64-mswin64_100]


Documentation for return type of obj.object_id is wrong on Windows x64.

C:\Users\phasis>irb
irb(main):001:0> 0.1.object_id
=> -158526706883441454
irb(main):002:0> 0.1.object_id.class
=> Bignum

Here is a patch:
diff --git a/gc.c b/gc.c.new
index d52208d..2a0f26a 100644
--- a/gc.c
+++ b/gc.c.new
@@ -1670,8 +1670,8 @@ id2ref(VALUE obj, VALUE objid)
  *  Document-method: object_id
  *
  *  call-seq:
- *     obj.__id__       -> fixnum
- *     obj.object_id    -> fixnum
+ *     obj.__id__       -> integer
+ *     obj.object_id    -> integer
  *
  *  Returns an integer identifier for <i>obj</i>. The same number will
  *  be returned on all calls to <code>id</code> for a given object, and



-- 
http://bugs.ruby-lang.org/