Skip to content

Commit 160a7be

Browse files
fix: use TaskLocalValue in hashconsing
1 parent d61478b commit 160a7be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function exprtype(x::BasicSymbolic)
8181
end
8282
end
8383

84-
const wvd = WeakValueDict{UInt, BasicSymbolic}()
84+
const wvd = TaskLocalValue{WeakValueDict{UInt, BasicSymbolic}}(WeakValueDict{UInt, BasicSymbolic})
8585

8686
# Same but different error messages
8787
@noinline error_on_type() = error("Internal error: unreachable reached!")
@@ -525,7 +525,7 @@ function BasicSymbolic(s::BasicSymbolic)::BasicSymbolic
525525
return s
526526
end
527527
h = hash2(s)
528-
t = get!(wvd, h, s)
528+
t = get!(wvd[], h, s)
529529
if t === s || isequal_with_metadata(t, s)
530530
t
531531
else

0 commit comments

Comments
 (0)