From 8e68f3c42b2c502357d1681c553f9f507650f5a1 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Thu, 21 May 2026 20:42:59 +0200 Subject: [PATCH] avoid parameterizing GeneratedFunctionWrapper on the RGFs This causes a large number of functions that take this as an argument to specialize on different input models. This has no performance benefit in practice so just avoid doing that --- lib/ModelingToolkitBase/src/systems/codegen_utils.jl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/ModelingToolkitBase/src/systems/codegen_utils.jl b/lib/ModelingToolkitBase/src/systems/codegen_utils.jl index 233d126476..027eb73647 100644 --- a/lib/ModelingToolkitBase/src/systems/codegen_utils.jl +++ b/lib/ModelingToolkitBase/src/systems/codegen_utils.jl @@ -441,13 +441,9 @@ arguments, the second is the expected number of arguments in the out-of-place va of the function, and the third is a boolean indicating whether the generated functions are for a split system. For scalar functions, the inplace variant can be `nothing`. """ -struct GeneratedFunctionWrapper{P, O, I} <: Function - f_oop::O - f_iip::I -end - -function GeneratedFunctionWrapper{P}(foop::O, fiip::I) where {P, O, I} - return GeneratedFunctionWrapper{P, O, I}(foop, fiip) +struct GeneratedFunctionWrapper{P} <: Function + f_oop::Function + f_iip::Union{Function, Nothing} end function GeneratedFunctionWrapper{P}(::Type{Val{true}}, foop, fiip; kwargs...) where {P}