Skip to content

Commit

Permalink
Improve inferrability
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriel Baraldi <[email protected]>
  • Loading branch information
topolarity and gbaraldi committed Oct 9, 2024
1 parent f888022 commit 35afff8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ unsafe_convert(::Type{PlanPtr}, p::FFTWPlan) = p.plan
# This is accomplished by the maybe_destroy_plan function, which is used as the plan finalizer.

# these functions should only be called while the fftwlock is held
unsafe_destroy_plan(plan::FFTWPlan{<:fftwDouble}) =
unsafe_destroy_plan(@nospecialize(plan::FFTWPlan{<:fftwDouble})) =
ccall((:fftw_destroy_plan,libfftw3[]), Cvoid, (PlanPtr,), plan)
unsafe_destroy_plan(plan::FFTWPlan{<:fftwSingle}) =
unsafe_destroy_plan(@nospecialize(plan::FFTWPlan{<:fftwSingle})) =
ccall((:fftwf_destroy_plan,libfftw3f[]), Cvoid, (PlanPtr,), plan)

const deferred_destroy_lock = ReentrantLock() # lock protecting the deferred_destroy_plans list
Expand All @@ -335,7 +335,7 @@ function destroy_deferred()
# we'll do nothing (the other function will eventually run destroy_deferred).
if !isempty(deferred_destroy_plans) && trylock(fftwlock)
try
foreach(unsafe_destroy_plan, deferred_destroy_plans)
@inline foreach(unsafe_destroy_plan, deferred_destroy_plans)

Check warning on line 338 in src/fft.jl

View check run for this annotation

Codecov / codecov/patch

src/fft.jl#L338

Added line #L338 was not covered by tests
empty!(deferred_destroy_plans)
finally
unlock(fftwlock)
Expand Down

0 comments on commit 35afff8

Please sign in to comment.