Skip to content

[BUG] Capacity overflowing uint32 #80

Closed
@Alfus

Description

Description

I am trying to use bytes as my cost function, but the policy is silently casting the capacity from an int to a uint32. This effectively makes the max cache size 4GB, where values over that overflow and get a ~random size

To Reproduce

Set the capacity to math.MaxUint32 + 1 every entry will be rejected.

Expected behavior

Normal caching (or at least an error)

Environment

  • OS: macos

Additional context

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions