Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #33675, unpredictable summarysize on isbitsunion arrays #33713

Merged
merged 1 commit into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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