summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-27 03:07:02 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-27 03:07:02 +0000
commita12c1e4bd25c4600e809eb6271ef13ed5f8d5c17 (patch)
treeb498407cbc7ca7aabd9a70fb6d9fde54f493e8ce /gc.c
parentf933f9d3a5e5d71bcebc5d0a3206149870c412e0 (diff)
revered all LLP64 modifies due to portability reason.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/gc.c b/gc.c
index 586e9b0..7a2ae7d 100644
--- a/gc.c
+++ b/gc.c
@@ -990,7 +990,7 @@ gc_mark_children(ptr, lev)
break;
default:
- rb_bug("rb_gc_mark(): unknown data type %p(%p) %s",
+ rb_bug("rb_gc_mark(): unknown data type 0x%lx(0x%lx) %s",
obj->as.basic.flags & T_MASK, obj,
is_pointer_to_heap(obj) ? "corrupted object" : "non object");
}
@@ -1256,7 +1256,7 @@ obj_free(obj)
break;
default:
- rb_bug("gc_sweep(): unknown data type %p(%ld)", obj,
+ rb_bug("gc_sweep(): unknown data type 0x%lx(%ld)", obj,
RANY(obj)->as.basic.flags & T_MASK);
}
}
@@ -1883,18 +1883,10 @@ static VALUE
id2ref(obj, id)
VALUE obj, id;
{
-#if SIZEOF_LONG == SIZEOF_VOIDP
-#define NUM2PTR(x) NUM2ULONG(x)
-#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
-#define NUM2PTR(x) NUM2ULL(x)
-#endif
- VALUE ptr;
- void *p0;
+ unsigned long ptr, p0;
rb_secure(4);
- ptr = NUM2PTR(id);
- p0 = (void *)ptr;
-
+ p0 = ptr = NUM2ULONG(id);
if (ptr == Qtrue) return Qtrue;
if (ptr == Qfalse) return Qfalse;
if (ptr == Qnil) return Qnil;
@@ -1905,10 +1897,10 @@ id2ref(obj, id)
ptr = id ^ FIXNUM_FLAG; /* unset FIXNUM_FLAG */
if (!is_pointer_to_heap((void *)ptr)|| BUILTIN_TYPE(ptr) >= T_BLKTAG) {
- rb_raise(rb_eRangeError, "%p is not id value", p0);
+ rb_raise(rb_eRangeError, "0x%lx is not id value", p0);
}
if (BUILTIN_TYPE(ptr) == 0 || RBASIC(ptr)->klass == 0) {
- rb_raise(rb_eRangeError, "%p is recycled object", p0);
+ rb_raise(rb_eRangeError, "0x%lx is recycled object", p0);
}
return (VALUE)ptr;
}