@@ -66,16 +66,18 @@ struct RuntimeGeneratedFunction{argnames, cache_tag, context_tag, id, B} <: Func
6666
6767 # For internal use in deserialize() - doesen't check whether the body is in the cache!
6868 function RuntimeGeneratedFunction {argnames, cache_tag, context_tag, id} (body) where {
69- argnames,
70- cache_tag,
71- context_tag,
72- id,
73- }
69+ argnames,
70+ cache_tag,
71+ context_tag,
72+ id
73+ }
7474 new {argnames, cache_tag, context_tag, id, typeof(body)} (body)
7575 end
7676end
7777
78- drop_expr (:: RuntimeGeneratedFunction{A, C1, C2, ID} ) where {A, C1, C2, ID} = RuntimeGeneratedFunction {A, C1, C2, ID} (nothing )
78+ function drop_expr (:: RuntimeGeneratedFunction{A, C1, C2, ID} ) where {A, C1, C2, ID}
79+ RuntimeGeneratedFunction {A, C1, C2, ID} (nothing )
80+ end
7981
8082function _check_rgf_initialized (mods... )
8183 for mod in mods
@@ -172,7 +174,7 @@ function _cache_body(cache_tag, id, body)
172174 # canonical one rather than `body`. This ensures the lifetime of the
173175 # body in the cache will always cover the lifetime of the parent
174176 # `RuntimeGeneratedFunction`s when they share the same `id`.
175- cached_body = haskey (cache, id) ? cache[id]. value : nothing
177+ cached_body = haskey (cache, id) ? cache[id] : nothing
176178 cached_body = cached_body != = nothing ? cached_body : body
177179 # We cannot use WeakRef because we might drop body to make RGF GPU
178180 # compatible.
184186function _lookup_body (cache_tag, id)
185187 lock (_cache_lock) do
186188 cache = getfield (parentmodule (cache_tag), _cachename)
187- cache[id]. value
189+ cache[id]
188190 end
189191end
190192
@@ -295,13 +297,14 @@ end
295297# We write an explicit deserialize() here to trigger caching of the body on a
296298# remote node when using Serialialization.jl (in Distributed.jl and elsewhere)
297299function Serialization. deserialize (s:: AbstractSerializer ,
298- :: Type {<: RuntimeGeneratedFunction {argnames, cache_tag,
299- context_tag, id}}) where {
300- argnames,
301- cache_tag,
302- context_tag,
303- id
304- }
300+ :: Type {
301+ <: RuntimeGeneratedFunction {argnames, cache_tag,
302+ context_tag, id}}) where {
303+ argnames,
304+ cache_tag,
305+ context_tag,
306+ id
307+ }
305308 body = deserialize (s)
306309 cached_body = _cache_body (cache_tag, id, body)
307310 RuntimeGeneratedFunction {argnames, cache_tag, context_tag, id} (cached_body)
0 commit comments