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

ruby-changes:12284

From: nobu <ko1@a...>
Date: Tue, 7 Jul 2009 11:57:15 +0900 (JST)
Subject: [ruby-changes:12284] Ruby:r23977 (trunk): * gc.c (GC_PROF_SET_MALLOC_INFO, GC_PROF_SET_HEAP_INFO): simplified.

nobu	2009-07-07 11:56:57 +0900 (Tue, 07 Jul 2009)

  New Revision: 23977

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

  Log:
    * gc.c (GC_PROF_SET_MALLOC_INFO, GC_PROF_SET_HEAP_INFO): simplified.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23976)
+++ ChangeLog	(revision 23977)
@@ -1,3 +1,7 @@
+Tue Jul  7 11:56:52 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* gc.c (GC_PROF_SET_MALLOC_INFO, GC_PROF_SET_HEAP_INFO): simplified.
+
 Tue Jul  7 10:12:37 2009  NARUSE, Yui  <naruse@r...>
 
 	* io.c (rb_io_ext_int_to_encs): Set external encoding if
Index: gc.c
===================================================================
--- gc.c	(revision 23976)
+++ gc.c	(revision 23977)
@@ -205,22 +205,22 @@
     } while(0)
 #define GC_PROF_SET_MALLOC_INFO do {\
 	if (objspace->profile.run) {\
-	    size_t count = objspace->profile.count;\
-	    objspace->profile.record[count].allocate_increase = malloc_increase;\
-	    objspace->profile.record[count].allocate_limit = malloc_limit; \
+	    gc_profile_record *record = &objspace->profile.record[objspace->profile.count];\
+	    record->allocate_increase = malloc_increase;\
+	    record->allocate_limit = malloc_limit; \
 	}\
     } while(0)
 #define GC_PROF_SET_HEAP_INFO do {\
 	if (objspace->profile.run) {\
-	    size_t count = objspace->profile.count;\
-	    objspace->profile.record[count].heap_use_slots = heaps_used;\
-	    objspace->profile.record[count].heap_longlife_use_slots = objspace->heap.longlife_used;\
-	    objspace->profile.record[count].heap_live_objects = live + objspace->profile.longlife_objects;\
-	    objspace->profile.record[count].heap_free_objects = freed + (objspace->heap.longlife_used * HEAP_OBJ_LIMIT - objspace->profile.longlife_objects); \
-	    objspace->profile.record[count].heap_total_objects = heaps_used * HEAP_OBJ_LIMIT;\
-	    objspace->profile.record[count].have_finalize = final_list ? Qtrue : Qfalse;\
-	    objspace->profile.record[count].heap_use_size = (live + objspace->profile.longlife_objects) * sizeof(RVALUE); \
-	    objspace->profile.record[count].heap_total_size = heaps_used * (HEAP_OBJ_LIMIT * sizeof(RVALUE));\
+	    gc_profile_record *record = &objspace->profile.record[objspace->profile.count];\
+	    record->heap_use_slots = heaps_used;\
+	    record->heap_longlife_use_slots = objspace->heap.longlife_used;\
+	    record->heap_live_objects = live + objspace->profile.longlife_objects;\
+	    record->heap_free_objects = freed + (objspace->heap.longlife_used * HEAP_OBJ_LIMIT - objspace->profile.longlife_objects); \
+	    record->heap_total_objects = heaps_used * HEAP_OBJ_LIMIT;\
+	    record->have_finalize = final_list ? Qtrue : Qfalse;\
+	    record->heap_use_size = (live + objspace->profile.longlife_objects) * sizeof(RVALUE); \
+	    record->heap_total_size = heaps_used * (HEAP_OBJ_LIMIT * sizeof(RVALUE));\
 	}\
     } while(0)
 #else
@@ -233,10 +233,10 @@
 #define GC_PROF_SET_MALLOC_INFO
 #define GC_PROF_SET_HEAP_INFO do {\
 	if (objspace->profile.run) {\
-	    size_t count = objspace->profile.count;\
-	    objspace->profile.record[count].heap_total_objects = heaps_used * HEAP_OBJ_LIMIT;\
-	    objspace->profile.record[count].heap_use_size = (live + objspace->profile.longlife_objects) * sizeof(RVALUE); \
-	    objspace->profile.record[count].heap_total_size = heaps_used * HEAP_SIZE;\
+	    gc_profile_record *record = &objspace->profile.record[objspace->profile.count];\
+	    record->heap_total_objects = heaps_used * HEAP_OBJ_LIMIT;\
+	    record->heap_use_size = (live + objspace->profile.longlife_objects) * sizeof(RVALUE); \
+	    record->heap_total_size = heaps_used * HEAP_SIZE;\
 	}\
     } while(0)
 #endif

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

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