@@ -319,9 +319,9 @@ unsafe_convert(::Type{PlanPtr}, p::FFTWPlan) = p.plan
319319# This is accomplished by the maybe_destroy_plan function, which is used as the plan finalizer.
320320
321321# these functions should only be called while the fftwlock is held
322- unsafe_destroy_plan (plan:: FFTWPlan{<:fftwDouble} ) =
322+ unsafe_destroy_plan (@nospecialize ( plan:: FFTWPlan{<:fftwDouble} ) ) =
323323 ccall ((:fftw_destroy_plan ,libfftw3[]), Cvoid, (PlanPtr,), plan)
324- unsafe_destroy_plan (plan:: FFTWPlan{<:fftwSingle} ) =
324+ unsafe_destroy_plan (@nospecialize ( plan:: FFTWPlan{<:fftwSingle} ) ) =
325325 ccall ((:fftwf_destroy_plan ,libfftw3f[]), Cvoid, (PlanPtr,), plan)
326326
327327const deferred_destroy_lock = ReentrantLock () # lock protecting the deferred_destroy_plans list
@@ -335,7 +335,12 @@ function destroy_deferred()
335335 # we'll do nothing (the other function will eventually run destroy_deferred).
336336 if ! isempty (deferred_destroy_plans) && trylock (fftwlock)
337337 try
338- foreach (unsafe_destroy_plan, deferred_destroy_plans)
338+ @static if Base. VERSION >= v " 1.9"
339+ @inline foreach (unsafe_destroy_plan, deferred_destroy_plans)
340+ else
341+ # call-site @inline isn't supported on old versions of Julia
342+ foreach (unsafe_destroy_plan, deferred_destroy_plans)
343+ end
339344 empty! (deferred_destroy_plans)
340345 finally
341346 unlock (fftwlock)
0 commit comments