File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -134,12 +134,13 @@ function (ss::SummarySize)(obj::Array)
134134 if ! haskey (ss. seen, datakey)
135135 ss. seen[datakey] = true
136136 dsize = Core. sizeof (obj)
137- if isbitsunion (eltype (obj))
137+ T = eltype (obj)
138+ if isbitsunion (T)
138139 # add 1 union selector byte for each element
139140 dsize += length (obj)
140141 end
141142 size += dsize
142- if ! isempty (obj) && ! Base. allocatedinline (eltype (obj ))
143+ if ! isempty (obj) && ( ! Base. allocatedinline (T) || (T isa DataType && ! Base . datatype_pointerfree (T) ))
143144 push! (ss. frontier_x, obj)
144145 push! (ss. frontier_i, 1 )
145146 end
Original file line number Diff line number Diff line change @@ -302,6 +302,11 @@ let vec = vcat(missing, ones(100000))
302302 @test length (unique (summarysize (vec) for i = 1 : 20 )) == 1
303303end
304304
305+ # issue #40773
306+ let s = Set (1 : 100 )
307+ @test summarysize ([s]) > summarysize (s)
308+ end
309+
305310# issue #13021
306311let ex = try
307312 Main. x13021 = 0
You can’t perform that action at this time.
0 commit comments