Yiling-J / theine

high performance in-memory cache
BSD 3-Clause "New" or "Revised" License
364 stars 5 forks source link

OverflowError: cannot fit 'int' into an index-sized integer #14

Closed extesy closed 1 year ago

extesy commented 1 year ago

Here is the minimal test case:

from theine import Cache

cache: Cache = Cache(policy="tlfu", size=10000)

def test1() -> None:
    print(len(cache))
    cache.clear()

def test2() -> None:
    print(len(cache))
    cache.clear()

I am running this test file using pytest. Second test fails with OverflowError: cannot fit 'int' into an index-sized integer error. If I remove cache.clear() then it works. If I change the policy to "clockpro" then it also works.

Environment: MacOS 13.5.1, python 3.8.16.

Yiling-J commented 1 year ago

@extesy please upgrade theine-core to v0.4.3 and try again 🙏

extesy commented 1 year ago

@Yiling-J That fixed the problem. Thank you for a quick response!