Skip to content

Commit c49fe52

Browse files
authored
Merge pull request #83 from JamesWrigley/invalidation-fix
Add a type assertion to remove some invalidations
2 parents 340d001 + f7bdf66 commit c49fe52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/storage.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,10 @@ function sra_migrate!(sra::SimpleRecencyAllocator, state::RefState, ref_id, to_m
879879
# and go to the "to" device. The passed-in ref is inserted into the
880880
# "from" device.
881881
if ismissing(to_mem)
882-
# Try to minimize reads/writes
883-
sstate = storage_read(state)
882+
# Try to minimize reads/writes. Note the type assertion to help the
883+
# compiler with inference, this removes some Base._any() invalidations.
884+
sstate::StorageState = storage_read(state)
885+
884886
if sstate.data !== nothing
885887
# Try to keep it in memory
886888
to_mem = true

0 commit comments

Comments
 (0)