You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The serialization extension assumes that currentsize is always measured by the number of items in the LRU.
If we use another by function to measure size, then we error trying to serialize (which is good because it looks like deserialize depends on this assumption).
using LRUCache
using Serialization
lru =LRU{String,Vector{UInt8}}(; maxsize =1024, by = sizeof)
lru["asdf"] =rand(UInt8, 512)
# not the same@assert lru.currentsize ==512@assertlength(lru) ==1serialize(IOBuffer(), lru)
# ERROR: AssertionError: lru.currentsize == length(lru)
Would a PR contribution be welcome to help here?
The text was updated successfully, but these errors were encountered:
Yes definitely. It seems the @assert statement in the serialize method should not be there, and that removing that would resolve the issue. Maybe @jarbus who implemented the serialization extension can comment on why the @assert statement is there? Is that a leftover from debugging?
The serialization extension assumes that
currentsize
is always measured by the number of items in the LRU.If we use another
by
function to measure size, then we error trying toserialize
(which is good because it looks likedeserialize
depends on this assumption).Would a PR contribution be welcome to help here?
The text was updated successfully, but these errors were encountered: