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

chore(ext/ffi): Remove unnecessary byte_offset conditional slicing #15320

Conversation

aapoalas
Copy link
Collaborator

Previously I got panics in pointer TypedArray handling with empty arrays from slices with byte_offset as zero. I even checked it multiple times.

Somehow, that no longer occurs and these conditional slice handlings are unnecessary.

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM.

It was panicking before because it was not using 0.. range:

let pointer = &backing_store[byte_offset] as *const _ as *const u8;

See diff for #14997

@aapoalas
Copy link
Collaborator Author

LGTM.

It was panicking before because it was not using 0.. range:

let pointer = &backing_store[byte_offset] as *const _ as *const u8;

See diff for #14997

Oooh, I must've been somehow quite tired when I was writing that...

@littledivy littledivy merged commit 8911bdb into denoland:main Jul 27, 2022
@aapoalas aapoalas deleted the chore-ext-ffi-remove-unnecessary-backing-store-slicing branch October 9, 2022 08:01
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

2 participants