ruby-changes:29614
From: nagachika <ko1@a...>
Date: Thu, 27 Jun 2013 00:04:55 +0900 (JST)
Subject: [ruby-changes:29614] nagachika:r41666 (ruby_2_0_0): revert r41577 because it causes memory error on mswin CI.
nagachika 2013-06-27 00:04:43 +0900 (Thu, 27 Jun 2013) New Revision: 41666 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41666 Log: revert r41577 because it causes memory error on mswin CI. Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/gc.c branches/ruby_2_0_0/version.h Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 41665) +++ ruby_2_0_0/ChangeLog (revision 41666) @@ -33,14 +33,6 @@ Tue Jun 25 00:10:54 2013 Zachary Scott https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L33 * win32/README.win32: grammar typo by @blankenshipz [Fix GH-334] https://github.com/ruby/ruby/pull/334 -Sun Jun 23 00:09:12 2013 Masaya Tarui <tarui@r...> - - * gc.c: Fixup around GC by MALLOC. - Add allocate size to malloc_increase before GC - for updating limit in after_gc_sweep. - Reset malloc_increase into garbage_collect() - for preventing GC again soon. - Sun Jun 23 00:03:18 2013 Charlie Somerville <charliesome@r...> * ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead Index: ruby_2_0_0/gc.c =================================================================== --- ruby_2_0_0/gc.c (revision 41665) +++ ruby_2_0_0/gc.c (revision 41666) @@ -209,7 +209,6 @@ typedef struct rb_objspace { https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/gc.c#L209 struct { size_t limit; size_t increase; - size_t increase2; #if CALC_EXACT_MALLOC_SIZE size_t allocated_size; size_t allocations; @@ -272,7 +271,6 @@ int *ruby_initial_gc_stress_ptr = &rb_ob https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/gc.c#L271 #endif #define malloc_limit objspace->malloc_params.limit #define malloc_increase objspace->malloc_params.increase -#define malloc_increase2 objspace->malloc_params.increase2 #define heaps objspace->heap.ptr #define heaps_length objspace->heap.length #define heaps_used objspace->heap.used @@ -1978,8 +1976,6 @@ before_gc_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/gc.c#L1976 objspace->heap.free_num = 0; objspace->heap.free_slots = NULL; - malloc_increase2 += ATOMIC_SIZE_EXCHANGE(malloc_increase,0); - /* sweep unlinked method entries */ if (GET_VM()->unlinked_method_entry_list) { rb_sweep_method_entry(GET_VM()); @@ -1998,9 +1994,6 @@ after_gc_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/gc.c#L1994 } inc = ATOMIC_SIZE_EXCHANGE(malloc_increase, 0); - inc += malloc_increase2; - malloc_increase2 = 0; - if (inc > malloc_limit) { malloc_limit += (size_t)((inc - malloc_limit) * (double)objspace->heap.marked_num / (heaps_used * HEAP_OBJ_LIMIT)); @@ -3486,9 +3479,8 @@ vm_malloc_prepare(rb_objspace_t *objspac https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/gc.c#L3479 size += sizeof(size_t); #endif - ATOMIC_SIZE_ADD(malloc_increase, size); if ((ruby_gc_stress && !ruby_disable_gc_stress) || - malloc_increase > malloc_limit) { + (malloc_increase+size) > malloc_limit) { garbage_collect_with_gvl(objspace); } @@ -3498,6 +3490,8 @@ vm_malloc_prepare(rb_objspace_t *objspac https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/gc.c#L3490 static inline void * vm_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size) { + ATOMIC_SIZE_ADD(malloc_increase, size); + #if CALC_EXACT_MALLOC_SIZE ATOMIC_SIZE_ADD(objspace->malloc_params.allocated_size, size); ATOMIC_SIZE_INC(objspace->malloc_params.allocations); @@ -4083,7 +4077,7 @@ gc_prof_set_malloc_info(rb_objspace_t *o https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/gc.c#L4077 if (objspace->profile.run) { gc_profile_record *record = &objspace->profile.record[objspace->profile.count]; if (record) { - record->allocate_increase = malloc_increase + malloc_increase2; + record->allocate_increase = malloc_increase; record->allocate_limit = malloc_limit; } } Index: ruby_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 41665) +++ ruby_2_0_0/version.h (revision 41666) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" -#define RUBY_RELEASE_DATE "2013-06-26" -#define RUBY_PATCHLEVEL 244 +#define RUBY_RELEASE_DATE "2013-06-27" +#define RUBY_PATCHLEVEL 245 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 26 +#define RUBY_RELEASE_DAY 27 #include "ruby/version.h" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/