ruby-changes:32146
From: tmm1 <ko1@a...>
Date: Mon, 16 Dec 2013 11:50:51 +0900 (JST)
Subject: [ruby-changes:32146] tmm1:r44225 (trunk): gc.c: fix build with RGENGC_ESTIMATE_OLDMALLOC=0
tmm1 2013-12-16 11:50:45 +0900 (Mon, 16 Dec 2013) New Revision: 44225 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44225 Log: gc.c: fix build with RGENGC_ESTIMATE_OLDMALLOC=0 * gc.c (gc_info_decode): Fix build errors wheb compiled with RGENGC_ESTIMATE_OLDMALLOC=0 * gc.c (objspace_malloc_increase): ditto Modified files: trunk/ChangeLog trunk/gc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 44224) +++ ChangeLog (revision 44225) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Dec 16 11:49:26 2013 Aman Gupta <ruby@t...> + + * gc.c (gc_info_decode): Fix build errors wheb compiled with + RGENGC_ESTIMATE_OLDMALLOC=0 + * gc.c (objspace_malloc_increase): ditto + Sun Dec 15 13:38:29 2013 Koichi Sasada <ko1@a...> * ext/objspace/objspace.c (reachable_object_from_root_i): Index: gc.c =================================================================== --- gc.c (revision 44224) +++ gc.c (revision 44225) @@ -5175,7 +5175,10 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/gc.c#L5175 gc_info_decode(int flags, VALUE hash_or_key) { static VALUE sym_major_by = Qnil, sym_gc_by, sym_immediate_sweep, sym_have_finalizer; - static VALUE sym_nofree, sym_oldgen, sym_shady, sym_rescan, sym_stress, sym_oldmalloc; + static VALUE sym_nofree, sym_oldgen, sym_shady, sym_rescan, sym_stress; +#if RGENGC_ESTIMATE_OLDMALLOC + static VALUE sym_oldmalloc; +#endif static VALUE sym_newobj, sym_malloc, sym_method, sym_capi; VALUE hash = Qnil, key = Qnil; VALUE major_by; @@ -5198,7 +5201,9 @@ gc_info_decode(int flags, VALUE hash_or_ https://github.com/ruby/ruby/blob/trunk/gc.c#L5201 S(shady); S(rescan); S(stress); +#if RGENGC_ESTIMATE_OLDMALLOC S(oldmalloc); +#endif S(newobj); S(malloc); S(method); @@ -5898,11 +5903,15 @@ objspace_malloc_increase(rb_objspace_t * https://github.com/ruby/ruby/blob/trunk/gc.c#L5903 { if (new_size > old_size) { ATOMIC_SIZE_ADD(malloc_increase, new_size - old_size); +#if RGENGC_ESTIMATE_OLDMALLOC ATOMIC_SIZE_ADD(objspace->rgengc.oldmalloc_increase, new_size - old_size); +#endif } else { atomic_sub_nounderflow(&malloc_increase, old_size - new_size); +#if RGENGC_ESTIMATE_OLDMALLOC atomic_sub_nounderflow(&objspace->rgengc.oldmalloc_increase, old_size - new_size); +#endif } if (type == MEMOP_TYPE_MALLOC) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/