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

fix: Fix accessing mapped byte buffers if offset is not page size alligned #3679

Conversation

WojciechMazur
Copy link
Contributor

@WojciechMazur WojciechMazur commented Jan 16, 2024

Opening MappedByteBuffer with a position offset not being page size alligned would lead to failure in creating mapping using mmap or it's Windows counterpart. This PR fixes that and ensure we use correct page size alligned values. Also improves context of buffer exceptions for out of bounds and under/overflow exceptions. Additionally fixes usage of "empty" MappedByteBufferData, previous usage was only defining local methods which were never used, now we create an overriden instance.

@WojciechMazur WojciechMazur changed the title fix: Fix accessing mapped byte buffers if offset is non page alligned fix: Fix accessing mapped byte buffers if offset is not page size alligned Jan 16, 2024
@WojciechMazur WojciechMazur merged commit c8987ab into scala-native:main Jan 16, 2024
62 checks passed
@WojciechMazur WojciechMazur deleted the fix/mapped-byte-buffer-non-aligned branch January 16, 2024 12:50
WojciechMazur added a commit to WojciechMazur/scala-native that referenced this pull request Jan 25, 2024
…igned (scala-native#3679)

* Fix accessing mapped byte buffers if offset is not page alligned
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.

None yet

1 participant