diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-20 07:43:54 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-20 07:43:54 +0000 |
commit | 94f42d6d79717c19f20e33ca4a29ce206d79f74e (patch) | |
tree | c2fc735d718bfd570c8f4e361ac2979817822838 /gc.c | |
parent | b9bd8eaf3b973268b898df22ee4cdadca7d15730 (diff) |
* 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
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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) |