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

Big alloc fallback #474

Merged
merged 2 commits into from
Nov 9, 2017
Merged

Conversation

bsmiles32
Copy link
Member

Another try at the memory allocation failure encountered in some Android devices. As this is likely due to a shortage of virtual memory, in this PR we provide a fallback mechanism which requires much less memory.

We keep a memory base, but much smaller ~73M. It is a concatenation of
RAM, ROM, DD_ROM, RSP_MEM and PIF_MEM. A helper function translate a N64
physical address into a suitable pointer in memory_base.
The big 512M allocation is tried first and if it fails, try the smaller
one. We encode the selected mode (full or compressed) using the LSB of
the base_mem pointer.
This should allow systems with enough virtual memory to use the full mem
base mode, while still allowing other systems to use the compressed mem
base mode.
@loganmc10
Copy link
Member

Tested both modes on Linux, no issues

@fzurita
Copy link
Member

fzurita commented Nov 9, 2017

I have confirmation from a user with the issue that this now works correctly! I can also confirm that it works correctly on Android devices that don't have the issue. This should be merged soon.

@bsmiles32 bsmiles32 merged commit 6efa097 into mupen64plus:master Nov 9, 2017
@bsmiles32 bsmiles32 deleted the big_alloc_fallback branch February 3, 2018 12:04
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.

3 participants