Repository navigation
feat(libc): implement malloc_usable_size - #3225
Merged
adriadam10 merged 1 commit intoOct 11, 2026
Merged
Conversation
9 tasks done
Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
Author
|
Rebased on main after #3229. The only conflict was the TechnicalDebt line's neighbour; the line moved next to the other heap entries. |
adriadam10
force-pushed
the
feat/libc-malloc-usable-size
branch
from
October 11, 2026 02:41
6c76263 to
859f2f3
Compare
Collaborator
Author
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
malloc_usable_size(NDcSfcYZRC8, imported fromlibSceLibcInternal) isn't exported. Since #1529, Linux binds those imports to the system libraries, so a catalog homebrew title stops on it at load onmain:mainf1ae427./app.elf: symbol lookup error: ./app.elf: undefined symbol: NDcSfcYZRC8It goes through the application heap the same way
malloc_stats_fastdoes:libc.prx(the one Astro's Playroom ships) does the same: itsmalloc_usable_sizeis a jump through that table slot. The entry order follows KytyPS5'sMallocReplace(malloc,free,calloc,realloc,memalign,reallocalign,posix_memalign,malloc_stats,malloc_stats_fast,malloc_usable_size). If the table leaves that entry null, it throws, asmalloc_stats_fastdoes.GuestAllocations. Sony's allocator reports its rounded-up chunk size instead. Both satisfy "at least the requested size", and handing out bytes past the registered range would let the title write memory that isn't write-watched. TechnicalDebt records this.Tested
Linux (CachyOS), GCC 16, Release.
application_heap_stats,application_heap_stats_defaultandapplication_heap_stats_missingpass. The new cases:mainthe test doesn't link.main's relinker and launched. It stops at load with the line above.tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)