From 94f42d6d79717c19f20e33ca4a29ce206d79f74e Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 20 Dec 2012 07:43:54 +0000 Subject: [PATCH] * gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on LLP64 platform, such as 64bit Windows. reporeted by Heesob Park at [ruby-core:50255] [Bug #7454], and the fix is suggested by akr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ gc.c | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d34e9d58c1..b3c6378eb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Dec 20 16:40:13 2012 NAKAMURA Usaku + + * gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on + LLP64 platform, such as 64bit Windows. + reporeted by Heesob Park at [ruby-core:50255] [Bug #7454], and the + fix is suggested by akr. + Thu Dec 20 16:39:04 2012 Martin Bosslet * ext/openssl/ossl_cipher.c: fix errors for installations that do not diff --git a/gc.c b/gc.c index c87526d016..217d23be4c 100644 --- a/gc.c +++ b/gc.c @@ -290,7 +290,13 @@ int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress; #define is_lazy_sweeping(objspace) ((objspace)->heap.sweep_slots != 0) -#define nonspecial_obj_id(obj) (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG) +#if SIZEOF_LONG == SIZEOF_VOIDP +# define nonspecial_obj_id(obj) (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG) +#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP +# define nonspecial_obj_id(obj) LL2NUM((SIGNED_VALUE)(obj) / 2) +#else +# error not supported +#endif #define RANY(o) ((RVALUE*)(o)) #define has_free_object (objspace->heap.free_slots && objspace->heap.free_slots->freelist)