[MEMFS] Assume FS.write is takes a TypedArray.#26413
Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Open
[MEMFS] Assume FS.write is takes a TypedArray.#26413sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
FS.write is takes a TypedArray.#26413sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
b78a8cd to
8ac558e
Compare
8ac558e to
618cc68
Compare
kripken
reviewed
Mar 9, 2026
Member
kripken
left a comment
There was a problem hiding this comment.
Does this affect compatibility with WasmFS? I mean, does the parallel WasmFS API behave the same?
Collaborator
Author
Hmm, good call. I updated wasmfs too and created a shared utility for converting incoming file data. |
618cc68 to
cd0438f
Compare
sbc100
commented
Mar 9, 2026
Collaborator
Author
sbc100
left a comment
There was a problem hiding this comment.
If you like I can split out the new FS_fileDataToTypedArray function as separate NFC?
kripken
approved these changes
Mar 9, 2026
Member
kripken
left a comment
There was a problem hiding this comment.
No need to split stuff out here, imo
We have higher level wrappers such as `createDataFile` which also accept `Array` and `string`, but it simpler if the lower level APIs just assume `TypedArray`. This simplifies the code and reduces code size. We have assertions to check this in debug builds. Followup to emscripten-core#26398 and emscripten-core#26411
cd0438f to
ab3c82d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have higher level wrappers
createDataFileandwriteFilewhich also acceptArrayandstring, but it simpler if the lower level APIs can just assumeTypedArray.This simplifies the code and reduces code size. We have assertions to check this in debug builds.
Followup to #26398 and #26411