Skip to content

Commit 49c2d89

Browse files
authored
jltypes: avoid creating lots of duplicates of this function (#52299)
Core.Compiler calls this on many functions, creating associated Types inferred for each for some reason. This saves several MB from the system image.
1 parent 9ea29d9 commit 49c2d89

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

base/array.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,8 @@ function setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T}
977977
return A
978978
end
979979

980+
__safe_setindex!(A::Vector{Any}, @nospecialize(x), i::Int) = (@inline; @_nothrow_noub_meta;
981+
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
980982
__safe_setindex!(A::Vector{T}, x::T, i::Int) where {T} = (@inline; @_nothrow_noub_meta;
981983
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
982984
__safe_setindex!(A::Vector{T}, x, i::Int) where {T} = (@inline;

0 commit comments

Comments
 (0)