[PR #2838] [MERGED] sceKernelAllocateDirectMemory hotfixes #3018

Closed
opened 2026-02-27 22:02:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2838
Author: @StevenMiller123
Created: 4/24/2025
Status: Merged
Merged: 4/24/2025
Merged by: @squidbus

Base: mainHead: more-memory-fixes


📝 Commits (2)

📊 Changes

1 file changed (+3 additions, -5 deletions)

View changed files

📝 src/core/memory.cpp (+3 -5)

📄 Description

This should (hopefully) be the last time I'll need to PR fixes to this thing.

The main issue this addresses is that the end of an allocation doesn't need to be aligned to our alignment value. Fixing this should address the regression seen in https://github.com/shadps4-emu/shadps4-game-compatibility/issues/451

I've also cleaned up the logic slightly, as we should never need to check against search_start in the while loop. That code will never execute on a dmem area containing the search_start address, since the dmem area returned by FindDmemArea will contain search_start, and the while loop only triggers when we need to iterate past that mapping.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2838 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 4/24/2025 **Status:** ✅ Merged **Merged:** 4/24/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `more-memory-fixes` --- ### 📝 Commits (2) - [`ae39cad`](https://github.com/shadps4-emu/shadPS4/commit/ae39cad847c120f4511aec0926c224e342aa8bd5) Update memory.cpp - [`2e175db`](https://github.com/shadps4-emu/shadPS4/commit/2e175db7336cf332db396735d39ea7311352cb1f) Clean logic ### 📊 Changes **1 file changed** (+3 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/core/memory.cpp` (+3 -5) </details> ### 📄 Description This should (hopefully) be the last time I'll need to PR fixes to this thing. The main issue this addresses is that the end of an allocation doesn't need to be aligned to our alignment value. Fixing this should address the regression seen in https://github.com/shadps4-emu/shadps4-game-compatibility/issues/451 I've also cleaned up the logic slightly, as we should never need to check against search_start in the while loop. That code will never execute on a dmem area containing the search_start address, since the dmem area returned by FindDmemArea will contain search_start, and the while loop only triggers when we need to iterate past that mapping. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:08 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3018
No description provided.