summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-25 01:01:33 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-25 01:01:33 +0000
commit2a9ac6af7c022fe79ecbfb4b40fa4b538eab9be9 (patch)
tree9b7b65d81e0cbe2a9e52f9c1c2995355f3d563e5 /gc.c
parent29ff037211ba5a7516931d691cb6cc33f77ca6a9 (diff)
merge revision(s) 38548:
* gc.c (obj_id_to_ref): add a macro to treat Bignum object id. This follows the change r38493. * gc.c (id2ref): fix for working fine with Bignum object id on x64 Windows. * gc.c (wmap_finalize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index b42105bbcd..e38930de11 100644
--- a/gc.c
+++ b/gc.c
@@ -101,8 +101,11 @@ ruby_gc_params_t initial_params = {
#if SIZEOF_LONG == SIZEOF_VOIDP
# define nonspecial_obj_id(obj) (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG)
+# define obj_id_to_ref(objid) ((objid) ^ FIXNUM_FLAG) /* unset FIXNUM_FLAG */
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
# define nonspecial_obj_id(obj) LL2NUM((SIGNED_VALUE)(obj) / 2)
+# define obj_id_to_ref(objid) (FIXNUM_P(objid) ? \
+ ((objid) ^ FIXNUM_FLAG) : (NUM2PTR(objid) << 1))
#else
# error not supported
#endif
@@ -3208,7 +3211,7 @@ id2ref(VALUE obj, VALUE objid)
if (ptr == Qfalse) return Qfalse;
if (ptr == Qnil) return Qnil;
if (FIXNUM_P(ptr)) return (VALUE)ptr;
- ptr = objid ^ FIXNUM_FLAG; /* unset FIXNUM_FLAG */
+ ptr = obj_id_to_ref(objid);
if ((ptr % sizeof(RVALUE)) == (4 << 2)) {
ID symid = ptr / sizeof(RVALUE);