wpad: use malloc instead of lwp_wkspace alloc, check for OOM error#266
Open
Zarithya wants to merge 2 commits into
Open
wpad: use malloc instead of lwp_wkspace alloc, check for OOM error#266Zarithya wants to merge 2 commits into
Zarithya wants to merge 2 commits into
Conversation
Member
|
lgtm, any opinion @fincs ? |
Member
|
Lgtm. If only, it would be nice to fix this code to deallocate the memory on deinit. |
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.
When the lwp_wkspace was shrunk from 1MB to 64KB, Wiimotes stopped being able to be allocated, as they needed >100KB just to allocate the command queue! Previously, this error was occurring silently, meaning the first two Wiimotes would sync properly but the third was a toss-up and the fourth (and Balance Board) straight up crashed. This PR adds a check to ensure Wiimote init code bails out if out of memory, as well as moving non-essential allocations to use normal malloc instead of lwp_wkspace_alloc.