Skip to content

Commit 0cc2826

Browse files
Merge pull request #740 from AayushSabharwal/as/weakset
fix: remove `WeakValueDicts`
2 parents dd0505a + 5433fcd commit 0cc2826

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ TaskLocalValues = "ed4db957-447d-4319-bfb6-7fa9ae7ecf34"
2727
TermInterface = "8ea1fca8-c5ef-4a55-8b96-4e9afe9c9a3c"
2828
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
2929
Unityper = "a7c27f48-0311-42f6-a7f8-2c11e75eb415"
30-
WeakValueDicts = "897b6980-f191-5a31-bcb0-bf3c4585e0c1"
3130

3231
[weakdeps]
3332
LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800"
@@ -62,7 +61,6 @@ TaskLocalValues = "0.1.2"
6261
TermInterface = "2.0"
6362
TimerOutputs = "0.5"
6463
Unityper = "0.1.2"
65-
WeakValueDicts = "0.1.0"
6664
julia = "1.10"
6765

6866
[extras]

src/SymbolicUtils.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import TermInterface: iscall, isexpr, head, children,
2222
import ArrayInterface
2323
import ExproniconLite as EL
2424
import TaskLocalValues: TaskLocalValue
25-
import WeakValueDicts: WeakValueDict
2625

2726
include("WeakCacheSets.jl")
2827

src/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,15 +529,15 @@ Implements hash consing (flyweight design pattern) for `BasicSymbolic` objects.
529529
530530
This function checks if an equivalent `BasicSymbolic` object already exists. It uses a
531531
custom hash function (`hash2`) incorporating metadata and symtypes to search for existing
532-
objects in a `WeakValueDict` (`wvd`). Due to the possibility of hash collisions (where
532+
objects in a `WeakCacheSet` (`wcs`). Due to the possibility of hash collisions (where
533533
different objects produce the same hash), a custom equality check (`isequal_with_metadata`)
534534
which includes metadata comparison, is used to confirm the equivalence of objects with
535535
matching hashes. If an equivalent object is found, the existing object is returned;
536536
otherwise, the input `s` is returned. This reduces memory usage, improves compilation time
537537
for runtime code generation, and supports built-in common subexpression elimination,
538538
particularly when working with symbolic objects with metadata.
539539
540-
Using a `WeakValueDict` ensures that only weak references to `BasicSymbolic` objects are
540+
Using a `WeakCacheSet` ensures that only weak references to `BasicSymbolic` objects are
541541
stored, allowing objects that are no longer strongly referenced to be garbage collected.
542542
Custom functions `hash2` and `isequal_with_metadata` are used instead of `Base.hash` and
543543
`Base.isequal` to accommodate metadata without disrupting existing tests reliant on the

0 commit comments

Comments
 (0)