[AUDIO_WORKLET] Fix getentropy when called from an audio worklet.#26526
Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Open
[AUDIO_WORKLET] Fix getentropy when called from an audio worklet.#26526sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
0c8a5a5 to
19dc84b
Compare
kripken
reviewed
Mar 24, 2026
| random_get__deps: ['$randomFill'], | ||
| random_get: (buffer, size) => { | ||
| randomFill(HEAPU8.subarray(buffer, buffer + size)); | ||
| return 0; |
Member
There was a problem hiding this comment.
The moving of 0 seems to hurt code size iiuc? What is the benefit to this part?
Collaborator
Author
There was a problem hiding this comment.
With this change randomFill can (and does) return and error code. That is the fix here.
I guess there is 2 byte difference because in the normal case I now use the comma expression. I can't think of a cleaner way to do this and since its only 2 bytes I think its fine.
Collaborator
Author
There was a problem hiding this comment.
BTW the reason randomFill happens to be included in all the codesize tests is that the FS object depends on it to do FS.createDevice('/dev', 'urandom', randomByte);.. so all programs that use the filesystem pull this in.
19dc84b to
15ba984
Compare
15ba984 to
5d0310a
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.
Fixes: #26522, #13224