Repository navigation
feat(libc): implement malloc_stats - #17724
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
Progress report (7525f56 → eef67f0)📈 System libraries: 35.02% (+0.0026%, +1 implemented, -1 removed functions) ✅ 1 implemented
🗑️ 1 removed
Changed libraries (implemented exports)
|
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows check of head Setup: Windows 11 x64, WinLibs GCC 15.2.0 (r7), Ninja, Release,
AI-assisted: yes. |
What
malloc_stats(libSceLibcInternal, NIDCC-BLMBu9-I) was a parameterless stub that threwNotImplemented. It is nowint malloc_stats(void* stats)in libc, next tomalloc_stats_fast, and the libSceLibcInternal stub is removed so imports reach the libc export.MallocReplacemalloc_statssits immediately beforemalloc_stats_fast(entry 8) andmalloc_usable_size(entry 9), which libc already calls. A table that leaves the entry null throws, asmalloc_stats_fastdoes.malloc_stats_fastdoes, since the default heap's accounting is already exact: size 0x28 / version 1 returns 0 and writes the four sizes; any other size or version returns 1 and writes nothing; a null block throws.ApplicationHeap.cpp.The debt entry moves from
libSceLibcInternal.mdtolibc.md: nothing is measured on a PS5, the one-pointer signature followsmalloc_stats_fastand thesceLibcMspaceMallocStatsblock, and the size/version check was measured only formalloc_stats_fast(#11870).Tested
Linux x86-64, GCC, Release with
BUILD_TESTING=ON, onmain9490483.application_heap_stats,application_heap_stats_defaultandapplication_heap_stats_missingpass. They now also check thatmalloc_statscalls entry 7 (not entry 8) with the caller's pointer, null included, and returns its result; that an allocation from inside the callback is rejected; that the default heap returns the same values asmalloc_stats_fastbefore and after allocating and freeing; that invalid sizes/versions return 1 with the block unchanged; that null throws; and that a missing entry throws.malloc_statsat entry 8 makesapplication_heap_statsabort.nm -Dshowsmalloc_stats_nid_postfixexported bylibc.prxand no longer bylibSceLibcInternal.prx.check_conventions.py --base origin/mainpasses.pr_overlap.pyreports only feat(libc): answer the CRT setup table and heap parameter queries #17008, which edits the neighbouring lines inApi.hppandFileAndHeap.cppbut not these functions, so either merge order works and the later one resolves a one-line conflict.Windows and PS5/title execution are untested.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Claude Code assisted with the implementation, tests and review.
🤖 Generated with Claude Code