[PR #3259] [CLOSED] Initialize the heap API and add new memory functions in HLE LibcInternal #3342

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3259
Author: @kalaposfos13
Created: 7/16/2025
Status: Closed

Base: mainHead: init-heap-api


📝 Commits (5)

  • 5cce714 Initialize the heap api
  • 04b6361 Add back memory functions that were already added once
  • e0af9aa Change heap API functions to the internal libc functions
  • 5ce97ce Add calloc and realloc
  • 1fc7573 Fine clang, you win

📊 Changes

3 files changed (+93 additions, -1 deletions)

View changed files

📝 src/core/libraries/libc_internal/libc_internal_memory.cpp (+58 -0)
📝 src/core/libraries/libc_internal/libc_internal_memory.h (+23 -0)
📝 src/core/linker.cpp (+12 -1)

📄 Description

Applications that do not use their own libc.prx and instead rely on libSceLibcInternal will not initialize this, and will crash on the first call of any of these functions. This PR initializes the heap API so there's at least something for these apps to work with. I tested it with NPXS20001, and it seems to work, by comparing its behaviour to when I put a libc.prx from one of my games to its sce_module folder. However, since I'm not too knowledgeable on this topic, I'll open it as a draft for now.


🔄 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/3259 **Author:** [@kalaposfos13](https://github.com/kalaposfos13) **Created:** 7/16/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `init-heap-api` --- ### 📝 Commits (5) - [`5cce714`](https://github.com/shadps4-emu/shadPS4/commit/5cce7145987dfa8c7b269642c165faa7b8f7b935) Initialize the heap api - [`04b6361`](https://github.com/shadps4-emu/shadPS4/commit/04b636102050085491fbb8c7a7f4cb292f32b856) Add back memory functions that were already added once - [`e0af9aa`](https://github.com/shadps4-emu/shadPS4/commit/e0af9aa633ec84dabc62fdee28d41aac463ec73e) Change heap API functions to the internal libc functions - [`5ce97ce`](https://github.com/shadps4-emu/shadPS4/commit/5ce97ce798b9094dba369327740ff78cc90c2500) Add calloc and realloc - [`1fc7573`](https://github.com/shadps4-emu/shadPS4/commit/1fc757378e2cebb1ff3ab22712d2729269d134e9) Fine clang, you win ### 📊 Changes **3 files changed** (+93 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/libc_internal/libc_internal_memory.cpp` (+58 -0) 📝 `src/core/libraries/libc_internal/libc_internal_memory.h` (+23 -0) 📝 `src/core/linker.cpp` (+12 -1) </details> ### 📄 Description Applications that do not use their own libc.prx and instead rely on libSceLibcInternal will not initialize this, and will crash on the first call of any of these functions. This PR initializes the heap API so there's at least something for these apps to work with. I tested it with NPXS20001, and it seems to work, by comparing its behaviour to when I put a libc.prx from one of my games to its sce_module folder. However, since I'm not too knowledgeable on this topic, I'll open it as a draft for now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:21 +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#3342
No description provided.