From 49c2d89a2286288263fd4b7bc60e04da999ebc12 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Sun, 26 Nov 2023 00:20:52 -0500 Subject: [PATCH] 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. --- base/array.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base/array.jl b/base/array.jl index e90723957afdb..23a1a59052147 100644 --- a/base/array.jl +++ b/base/array.jl @@ -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;