diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-15 23:06:32 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-15 23:06:32 +0000 |
commit | f5c2e89cd44a27b2391f94cb1b9cad74b9be692d (patch) | |
tree | 9702f300afa9da64216b85f82f7eab0a34d1e184 /gc.c | |
parent | 356644685e5f27df9c2dfdacfdff4cb1d7383136 (diff) | |
download | ruby-f5c2e89cd44a27b2391f94cb1b9cad74b9be692d.tar.gz |
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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -6231,6 +6231,8 @@ objspace_xcalloc(rb_objspace_t *objspace, size_t count, size_t elsize) 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); } |