xenia icon indicating copy to clipboard operation
xenia copied to clipboard

[Memory] VirtualAlloc behaviour while reusing allocated page

Open Gliniak opened this issue 4 years ago • 3 comments

I found out that actual behaviour of VirtualAlloc isn't exactly correct.

Affected methods: BaseHeap::AllocFixed, BaseHeap::AllocRange (probably)

Actual Behaviour

Right now when we're recommiting already commited page it clears that page content, which is incorrect.

Expected Behaviour

If we have already commited page and trying to recommit or reserve (from what I understand you cannot reserve already reserved page, but you can reserve if it is commited) it then previous content should stay intact.

Microsoft Docs: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc Test case: https://pastebin.com/ZVhff5Ec (Based of Microsoft example)

<placeholder 💃 >

Gliniak avatar Nov 02 '20 21:11 Gliniak

Resolved in: https://github.com/xenia-project/xenia/pull/1718

Gliniak avatar Apr 07 '21 12:04 Gliniak

Not fully resolved yet possibly — still need to validate the behavior in a range with both committed and uncommitted pages (currently only making the decision based on the original allocation region for the beginning of the range).

Triang3l avatar Apr 07 '21 12:04 Triang3l

Sorry, my bad.

Gliniak avatar Apr 07 '21 12:04 Gliniak