Skip to content

Commit

Permalink
jltypes: avoid creating lots of duplicates of this function (#52299)
Browse files Browse the repository at this point in the history
Core.Compiler calls this on many functions, creating associated Types
inferred for each for some reason. This saves several MB from the system
image.
  • Loading branch information
vtjnash authored Nov 26, 2023
1 parent 9ea29d9 commit 49c2d89
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,8 @@ function setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T}
return A
end

__safe_setindex!(A::Vector{Any}, @nospecialize(x), i::Int) = (@inline; @_nothrow_noub_meta;
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
__safe_setindex!(A::Vector{T}, x::T, i::Int) where {T} = (@inline; @_nothrow_noub_meta;
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
__safe_setindex!(A::Vector{T}, x, i::Int) where {T} = (@inline;
Expand Down

0 comments on commit 49c2d89

Please sign in to comment.