feat(libc): implement malloc_usable_size #3225
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3225"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T02:04:40Z.
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:mainf1ae427b6./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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T02:05:02Z.
Progress report (
aac0f1b→859f2f3)📈 System libraries: 86.0% (+0.01%, +1 implemented functions)
✅ 1 implemented
malloc_usable_size_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T02:41:55Z.
Rebased on main after #3229. The only conflict was the TechnicalDebt line's neighbour; the line moved next to the other heap entries.
application_heap_stats*pass again.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T02:49:55Z.
Merged: Linux CI is red only on
agc_unit_shadow, which main has failed since #2864 (reported in #3215). Windows passed, andapplication_heap_stats*passed on both.