[PR #1085] [MERGED] core/memory: Pooled memory implementation #1919

Closed
opened 2026-02-27 21:14:28 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1085
Author: @polybiusproxy
Created: 9/26/2024
Status: Merged
Merged: 9/29/2024
Merged by: @georgemoralis

Base: mainHead: core/memory-pool


📝 Commits (1)

  • f62e647 core/memory: Pooled memory implementation

📊 Changes

12 files changed (+301 additions, -11 deletions)

View changed files

📝 src/common/alignment.h (+12 -0)
📝 src/core/libraries/kernel/file_system.cpp (+2 -1)
📝 src/core/libraries/kernel/libkernel.cpp (+21 -1)
📝 src/core/libraries/kernel/memory_management.cpp (+98 -0)
📝 src/core/libraries/kernel/memory_management.h (+7 -0)
📝 src/core/libraries/kernel/thread_management.cpp (+9 -1)
📝 src/core/libraries/save_data/save_backup.cpp (+1 -1)
📝 src/core/libraries/save_data/save_memory.cpp (+1 -1)
📝 src/core/libraries/videoout/driver.cpp (+1 -1)
📝 src/core/memory.cpp (+129 -0)
📝 src/core/memory.h (+19 -4)
📝 src/video_core/amdgpu/liverpool.cpp (+1 -1)

📄 Description

Pooled memory is, under the hood, direct memory partitioned in 64 KiB blocks, with the difference that developers don't have to be aware of physical addresses and only care about the virtual address space, which can make allocations easier for the developer.

The memory pool can be expanded (direct memory is allocated for pool usage and can no longer be used as normal direct memory), reserved (reserved area must be aligned to 2MB or a multiple of it), committed, and decommitted.

This PR lacks memory pool batching and getting block statistics, but I haven't seen any game using these.
Frequently used by newer revisions of Unreal Engine.


🔄 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/1085 **Author:** [@polybiusproxy](https://github.com/polybiusproxy) **Created:** 9/26/2024 **Status:** ✅ Merged **Merged:** 9/29/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `core/memory-pool` --- ### 📝 Commits (1) - [`f62e647`](https://github.com/shadps4-emu/shadPS4/commit/f62e647e92f35cd131eb0760cab92ae1485ca1f9) core/memory: Pooled memory implementation ### 📊 Changes **12 files changed** (+301 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/common/alignment.h` (+12 -0) 📝 `src/core/libraries/kernel/file_system.cpp` (+2 -1) 📝 `src/core/libraries/kernel/libkernel.cpp` (+21 -1) 📝 `src/core/libraries/kernel/memory_management.cpp` (+98 -0) 📝 `src/core/libraries/kernel/memory_management.h` (+7 -0) 📝 `src/core/libraries/kernel/thread_management.cpp` (+9 -1) 📝 `src/core/libraries/save_data/save_backup.cpp` (+1 -1) 📝 `src/core/libraries/save_data/save_memory.cpp` (+1 -1) 📝 `src/core/libraries/videoout/driver.cpp` (+1 -1) 📝 `src/core/memory.cpp` (+129 -0) 📝 `src/core/memory.h` (+19 -4) 📝 `src/video_core/amdgpu/liverpool.cpp` (+1 -1) </details> ### 📄 Description Pooled memory is, under the hood, direct memory partitioned in 64 KiB blocks, with the difference that developers don't have to be aware of physical addresses and only care about the virtual address space, which can make allocations easier for the developer. The memory pool can be expanded (direct memory is allocated for pool usage and can no longer be used as normal direct memory), reserved (reserved area must be aligned to 2MB or a multiple of it), committed, and decommitted. This PR lacks memory pool batching and getting block statistics, but I haven't seen any game using these. Frequently used by newer revisions of Unreal Engine. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:14:28 +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#1919
No description provided.