[前][次][番号順一覧][スレッド一覧]

ruby-changes:26442

From: usa <ko1@a...>
Date: Thu, 20 Dec 2012 16:44:03 +0900 (JST)
Subject: [ruby-changes:26442] usa:r38493 (trunk): * gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on

usa	2012-12-20 16:43:54 +0900 (Thu, 20 Dec 2012)

  New Revision: 38493

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38493

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38492)
+++ ChangeLog	(revision 38493)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Dec 20 16:40:13 2012  NAKAMURA Usaku  <usa@r...>
+
+	* 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  <Martin.Bosslet@g...>
 
 	* ext/openssl/ossl_cipher.c: fix errors for installations that do not
Index: gc.c
===================================================================
--- gc.c	(revision 38492)
+++ gc.c	(revision 38493)
@@ -290,7 +290,13 @@ int *ruby_initial_gc_stress_ptr = &rb_ob https://github.com/ruby/ruby/blob/trunk/gc.c#L290
 
 #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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]