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(ext/ffi): Add support to get ArrayBuffers from UnsafePointerView #15143

Merged

Conversation

aapoalas
Copy link
Collaborator

This PR changes for UnsafePointerView's getArrayBuffer method to actually return an ArrayBuffer backed by the actual pointer's source data. This means that mutable data can be mutated directly from JS without any library APIs or specific FFI APIs.

This is absolutely unsafe and can easily lead to segfaults. Users need to be massively careful with this. At the same time, this is also something that is eg. needed by ObjectC C API.

@aapoalas aapoalas force-pushed the feat-ext-ffi-pointer-to-array-buffer branch from 68a340a to 4d06d71 Compare July 12, 2022 08:04
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

@littledivy littledivy merged commit e1cbd23 into denoland:main Jul 23, 2022
@aapoalas aapoalas deleted the feat-ext-ffi-pointer-to-array-buffer branch July 23, 2022 17:19
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