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

Fixes a check for what mmap returns. #705

Merged
merged 1 commit into from Jul 31, 2014

Conversation

Sonicadvance1
Copy link
Contributor

On error mmap returns MAP_FAILED(-1) not null.
FreeBSD was checking the return correctly, Linux was not.
This was noticed by triad attempting to run Dolphin under valgrind and not getting a memory space under the 2GB limit(Because -1 wraps around on
unsigned obviously)

On error mmap returns MAP_FAILED(-1) not null.
FreeBSD was checking the return correctly, Linux was not.
This was noticed by triad attempting to run Dolphin under valgrind and not getting a memory space under the 2GB limit(Because -1 wraps around on
unsigned obviously)
@Sonicadvance1
Copy link
Contributor Author

Windows returns NULL on VirtualAlloc failure.
Not Windows returns MAP_FAILED(-1).
Most likely an oversight on my part when initially implementing this.

@lioncash
Copy link
Member

Looks good to me.

lioncash added a commit that referenced this pull request Jul 31, 2014
@lioncash lioncash merged commit c5188c7 into dolphin-emu:master Jul 31, 2014
@Sonicadvance1 Sonicadvance1 deleted the fix-memoryutil-check branch July 31, 2014 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants