Skip to content

Avoid a panic when inserting into a zero-capacity cache - #71

Open
yuefdev wants to merge 1 commit into
zyedidia:masterfrom
yuefdev:fix/zero-capacity-cache
Open

yuefdev wants to merge 1 commit into
zyedidia:masterfrom
yuefdev:fix/zero-capacity-cache

Conversation

@yuefdev

@yuefdev yuefdev commented Oct 18, 2026

Copy link
Copy Markdown

Putting an entry into a zero-capacity cache panics, including after Resize(0).

Skip inserts while capacity is zero. The regression also checks that growing the cache enables inserts again. It fails before the fix; the full race suite and vet pass.

Signed-off-by: Yusuf Efe <120668197+yuefdev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant