aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-13 06:43:17 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-13 06:43:17 +0000
commitab77e273bea448bb5354293c993666fdd27294d9 (patch)
tree0a1111a1c94dcfd612426ee060bc40240a360322 /array.c
parenta4722a02e9a531b910723fe1c2224b7d383a85e2 (diff)
downloadruby-ab77e273bea448bb5354293c993666fdd27294d9.tar.gz
array.c: report correct memsize for shared root arrays
For a shared array root, struct RArray::as.heap.aux.capa stores the number of Arrays holding reference to that T_ARRAY instead of the actual heap-allocated capacity. Use ARY_CAPA() macro which handles this appropriately. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index 669b677959..329061f9c0 100644
--- a/array.c
+++ b/array.c
@@ -555,7 +555,7 @@ RUBY_FUNC_EXPORTED size_t
rb_ary_memsize(VALUE ary)
{
if (ARY_OWNS_HEAP_P(ary)) {
- return RARRAY(ary)->as.heap.aux.capa * sizeof(VALUE);
+ return ARY_CAPA(ary) * sizeof(VALUE);
}
else {
return 0;