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

Add a way for Swift code to access raw contents of a Typed Array #151

Merged
merged 4 commits into from
Jan 24, 2022

Conversation

yonihemi
Copy link
Member

Adds a withUnsafeBytes function allowing Swift code to access the entire backing buffer of a JavaScript typed array.

Motivation: Currently the way to use the data of a typed array in Swift is accessing one element at a time, passing each value through the runtime bridge.

@yonihemi yonihemi added the enhancement New feature or request label Jan 24, 2022
Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
@yonihemi yonihemi marked this pull request as draft January 24, 2022 08:52
@yonihemi yonihemi marked this pull request as ready for review January 24, 2022 09:16
@yonihemi yonihemi merged commit 53a2de6 into swiftwasm:main Jan 24, 2022
@yonihemi yonihemi deleted the copy_typed_array branch January 24, 2022 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants