Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add max slice alloc size config #376

Merged
merged 5 commits into from
Apr 20, 2024

Conversation

brianshih1
Copy link
Contributor

I introduced the defaultMaxSliceAllocSize config for security reasons, similar to Config.MaxByteSliceSize introduced in this PR.

I need a way to prevent the array decoder from consuming too much memory for my application, the defaultMaxSliceAllocSize is the limit for how much memory the arrayDecoder can allocate.

Let me know if you think I should just reuse MaxByteSliceSize instead of introducing a new config.

Copy link
Member

@nrwiersma nrwiersma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the addition of the config option over reusing the existing one. 1 small comment.

codec_array.go Outdated Show resolved Hide resolved
config.go Outdated Show resolved Hide resolved
@brianshih1 brianshih1 requested a review from nrwiersma April 20, 2024 16:38
Copy link
Member

@nrwiersma nrwiersma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉 Thanks for the contribution.

@nrwiersma nrwiersma merged commit b43fe48 into hamba:main Apr 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants