SciML / RuntimeGeneratedFunctions.jl

Functions generated at runtime without world-age issues or overhead
https://docs.sciml.ai/RuntimeGeneratedFunctions/stable/
MIT License
100 stars 14 forks source link

Re-enable GC of RGFs which haven't been `drop_expr()`d #63

Closed c42f closed 1 year ago

c42f commented 1 year ago

Revert some of https://github.com/SciML/RuntimeGeneratedFunctions.jl/pull/62

Originally GC of RGFs was implemented because people seemed to need it. So dropping support for this completely doesn't seem great.

Instead, this PR lets normal RGF bodies be GC'd as always. But if one calls drop_expr, we upgrade the WeakRef to a normal strong reference in the cache, preventing the body from being GC'd thereafter.

codecov[bot] commented 1 year ago

Codecov Report

Merging #63 (74838eb) into master (4ffaeb3) will decrease coverage by 4.38%. The diff coverage is 41.66%.

@@            Coverage Diff             @@
##           master      #63      +/-   ##
==========================================
- Coverage   94.00%   89.62%   -4.38%     
==========================================
  Files           1        1              
  Lines         100      106       +6     
==========================================
+ Hits           94       95       +1     
- Misses          6       11       +5     
Impacted Files Coverage Δ
src/RuntimeGeneratedFunctions.jl 89.62% <41.66%> (-4.38%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

c42f commented 1 year ago

Ok I think I cleaned those things up now. Should be good to go :)