Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.

Throw better exceptions from MemoryAllocators - #25

Merged
JimBobSquarePants merged 2 commits into
masterfrom
af/allocator-error-handling
Apr 22, 2019
Merged

JimBobSquarePants merged 2 commits into
masterfrom
af/allocator-error-handling

Conversation

@antonfirsov

@antonfirsov antonfirsov commented Apr 20, 2019 •

Copy link
Copy Markdown
Member

Validate arguments for allocation requests, providing a meaningful exception message when length would result in exceeding the maximum limit for the backing byte[] in ArrayPoolMemoryAlllocator.
This should partially address the issues reported in SixLabors/ImageSharp#636.

@dlemstra dlemstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition. Negative offsets really need a better exception.

Comment thread src/SixLabors.Core/Memory/ArrayPoolMemoryAllocator.cs Outdated

@JimBobSquarePants JimBobSquarePants left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is much more helpful!

@JimBobSquarePants
JimBobSquarePants merged commit 6a08952 into master Apr 22, 2019
@JimBobSquarePants
JimBobSquarePants deleted the af/allocator-error-handling branch April 22, 2019 01:23
antonfirsov pushed a commit to SixLabors/ImageSharp that referenced this pull request Jan 19, 2020
…cator-error-handling

Throw better exceptions from MemoryAllocators
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants