Skip to content

Commit

Permalink
fix #33675, unpredictable summarysize on isbitsunion arrays (#33713)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored and Keno committed Oct 29, 2019
1 parent 97f142f commit 1b6101a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/summarysize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function (ss::SummarySize)(obj::Array)
dsize += length(obj)
end
size += dsize
if !isbitstype(eltype(obj)) && !isempty(obj)
if !isempty(obj) && !Base.allocatedinline(eltype(obj))
push!(ss.frontier_x, obj)
push!(ss.frontier_i, 1)
end
Expand Down
5 changes: 5 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ end
@test summarysize(Vector{Nothing}(undef, 16)) == summarysize(Vector{Nothing}(undef, 32))
@test summarysize(S32881()) == sizeof(Int)

# issue #33675
let vec = vcat(missing, ones(100000))
@test length(unique(summarysize(vec) for i = 1:20)) == 1
end

# issue #13021
let ex = try
Main.x13021 = 0
Expand Down

0 comments on commit 1b6101a

Please sign in to comment.