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

ruby-changes:33268

From: normal <ko1@a...>
Date: Sun, 16 Mar 2014 08:06:37 +0900 (JST)
Subject: [ruby-changes:33268] normal:r45347 (trunk): gc.c (objspace_xcalloc): fix GC accounting

normal	2014-03-16 08:06:32 +0900 (Sun, 16 Mar 2014)

  New Revision: 45347

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

  Log:
    gc.c (objspace_xcalloc): fix GC accounting
    
    This hopefully works on all platforms with malloc_usable_size.
    This may also trigger bugs in places which did not expect GC, too;
    so maybe some existing code will need RB_GC_GUARD.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45346)
+++ ChangeLog	(revision 45347)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Mar 16 08:05:06 2014  Eric Wong  <e@8...>
+
+	* gc.c (objspace_xcalloc): fix GC accounting
+
 Sun Mar 16 06:33:35 2014  NARUSE, Yui  <naruse@r...>
 
 	* addr2line.c (fill_lines): return address is just after calling
Index: gc.c
===================================================================
--- gc.c	(revision 45346)
+++ gc.c	(revision 45347)
@@ -6231,6 +6231,8 @@ objspace_xcalloc(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L6231
     size = objspace_malloc_prepare(objspace, size);
 
     TRY_WITH_GC(mem = calloc(1, size));
+    size = objspace_malloc_size(objspace, mem, size);
+    objspace_malloc_increase(objspace, mem, size, 0, MEMOP_TYPE_MALLOC);
     return objspace_malloc_fixup(objspace, mem, size);
 }
 

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

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