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

ruby-changes:29074

From: tarui <ko1@a...>
Date: Fri, 7 Jun 2013 11:25:29 +0900 (JST)
Subject: [ruby-changes:29074] tarui:r41126 (trunk): * gc.c (MARKED_IN_BITMAP, MARK_IN_BITMAP, CLEAR_IN_BITMAP): bring

tarui	2013-06-07 11:25:19 +0900 (Fri, 07 Jun 2013)

  New Revision: 41126

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

  Log:
    * gc.c (MARKED_IN_BITMAP, MARK_IN_BITMAP, CLEAR_IN_BITMAP): bring
      bitmap macros in one place, and introduce BITMAP_BIT.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41125)
+++ ChangeLog	(revision 41126)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jun  7 11:20:57 2013  Masaya Tarui  <tarui@r...>
+
+	* gc.c (MARKED_IN_BITMAP, MARK_IN_BITMAP, CLEAR_IN_BITMAP): bring
+	  bitmap macros in one place, and introduce BITMAP_BIT.
+
 Fri Jun  7 11:18:35 2013  Masaya Tarui  <tarui@r...>
 
 	* array.c (ary_new): change order of allocation in order
Index: gc.c
===================================================================
--- gc.c	(revision 41125)
+++ gc.c	(revision 41126)
@@ -425,7 +425,12 @@ int *ruby_initial_gc_stress_ptr = &rb_ob https://github.com/ruby/ruby/blob/trunk/gc.c#L425
 #define NUM_IN_SLOT(p) (((uintptr_t)(p) & HEAP_ALIGN_MASK)/sizeof(RVALUE))
 #define BITMAP_INDEX(p) (NUM_IN_SLOT(p) / (sizeof(uintptr_t) * CHAR_BIT))
 #define BITMAP_OFFSET(p) (NUM_IN_SLOT(p) & ((sizeof(uintptr_t) * CHAR_BIT)-1))
-#define MARKED_IN_BITMAP(bits, p) (bits[BITMAP_INDEX(p)] & ((uintptr_t)1 << BITMAP_OFFSET(p)))
+#define BITMAP_BIT(p) ((uintptr_t)1 << BITMAP_OFFSET(p))
+/* Marking */
+#define MARKED_IN_BITMAP(bits, p) (bits[BITMAP_INDEX(p)] & BITMAP_BIT(p))
+#define MARK_IN_BITMAP(bits, p) (bits[BITMAP_INDEX(p)] = bits[BITMAP_INDEX(p)] | BITMAP_BIT(p))
+#define CLEAR_IN_BITMAP(bits, p) (bits[BITMAP_INDEX(p)] = bits[BITMAP_INDEX(p)] & ~BITMAP_BIT(p))
+
 
 #ifndef HEAP_ALIGN_LOG
 /* default tiny heap size: 16KB */
@@ -2561,11 +2566,6 @@ init_mark_stack(mark_stack_t *stack) https://github.com/ruby/ruby/blob/trunk/gc.c#L2566
 }
 
 
-/* Marking */
-
-#define MARK_IN_BITMAP(bits, p) (bits[BITMAP_INDEX(p)] = bits[BITMAP_INDEX(p)] | ((uintptr_t)1 << BITMAP_OFFSET(p)))
-#define CLEAR_IN_BITMAP(bits, p) (bits[BITMAP_INDEX(p)] = bits[BITMAP_INDEX(p)] & ~((uintptr_t)1 << BITMAP_OFFSET(p)))
-
 
 #ifdef __ia64
 #define SET_STACK_END (SET_MACHINE_STACK_END(&th->machine_stack_end), th->machine_register_stack_end = rb_ia64_bsp())

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

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