@Sukera I think it’s the field access, because otherwise fbare
should also allocate, no?
@BdeKoning To me that reads like it ensures type stability in presence of callable fields. From another thread I picked up the technique to parametrize the struct on the type of the function, FunctionWithExtra{A}
for example, which gives a concrete type to the struct. This works to avoid alloction with FunctionBare
, for example. Also,
julia> typeof(fwe)
FunctionWithExtra{var"#112#113"}
appears to have a concrete type. Am I mistaken?