@@ -319,9 +319,9 @@ unsafe_convert(::Type{PlanPtr}, p::FFTWPlan) = p.plan
319
319
# This is accomplished by the maybe_destroy_plan function, which is used as the plan finalizer.
320
320
321
321
# 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} ) ) =
323
323
ccall ((:fftw_destroy_plan ,libfftw3[]), Cvoid, (PlanPtr,), plan)
324
- unsafe_destroy_plan (plan:: FFTWPlan{<:fftwSingle} ) =
324
+ unsafe_destroy_plan (@nospecialize ( plan:: FFTWPlan{<:fftwSingle} ) ) =
325
325
ccall ((:fftwf_destroy_plan ,libfftw3f[]), Cvoid, (PlanPtr,), plan)
326
326
327
327
const deferred_destroy_lock = ReentrantLock () # lock protecting the deferred_destroy_plans list
@@ -335,7 +335,12 @@ function destroy_deferred()
335
335
# we'll do nothing (the other function will eventually run destroy_deferred).
336
336
if ! isempty (deferred_destroy_plans) && trylock (fftwlock)
337
337
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
339
344
empty! (deferred_destroy_plans)
340
345
finally
341
346
unlock (fftwlock)
0 commit comments