feat(libSceFreeType): provide the default memory record #12321
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12321"
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 santhoshkumar-dev on 2026-10-28T09:22:46Z.
What
Add
FT_New_Memory(tCMhTh7h8D4) andFT_Done_Memory(UTumVjeIQtg) to the physicallibSceFreeTypeadapter.FT_New_Memorytakes no arguments and returns a guestGuestMemoryRecwired to host allocator callbacks;FT_Done_Memoryreleases the record itself, matching the record-creation pairing. The record is the object the legacy allocator family (#12004) andFT_List_Finalizeoperate on, so a guest can now obtain a provider-backed record instead of building its own.The names/NIDs are in the PS5 3.20 inventory. The argument-less interface, null
user, callback wiring and record destruction follow FreeType 2.4.12 ftsystem.c, which agrees with the bundled FreeType 2.13.3 source on this interface; the callbacks wrap the host allocator instead of the console's system layer. Console equivalence is unverified and recorded in debt.The matching OT inventory helper is named
sceFreeTypeOtNewMemory_nid_no_patchand declared in the public header reachable through its umbrella; its no-parameter placeholder, explicit NID alias and throwing behavior remain. TheFT_Done_MemoryNID is not currently exported by this repository'slibSceFreeTypeOt(it carries a curated subset of the console inventory); completing that inventory is left to the maintainers' stub-curation PRs such as #11765 for the separatelibSceFreeTypeOlmodule, which shares no files with this change.Ordering: whole-branch comparisons at this head against current main
316615d042and against #11613 and #10606 are clean. #11878, #11996 and #12004 add an include line at the sameinclude/Api.hppspot; #11996 and #12004 additionally append the neighbouringCMakeLists.txtinclude and the adjacent debt entry. All are one-line insertions kept on rebase of whichever lands first; there is no functional or build dependency beyond the pairing noted above. Open/closed/merged history was rechecked for both names and NIDs immediately before opening; the only matches are #11765 (Ol-module stubs, different physical library) and a passing mention in #10606, whose library-lifetime change does not implement these functions and merges cleanly with this head.Tested
Submitted and tested head
6aea55b3db687ba4c8ce7d24c12837cf2ad5d3b1, based on upstream mainbbb11b6974df7889842ade9dd6fe55a5947b7654; it merges cleanly into current main316615d042.Windows 11 x64 / WinLibs GCC 15.2.0 r7 and local Ubuntu 24.04.1 x86-64 under WSL2 / GCC 13.3.0 / glibc 2.39: Ninja Release, bundled dependencies,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFF. On each platform the completelibstarget (including all packaged-NID.prxpatching) and selected test executables build, and 70/70 CTests pass: public-header audit, all 64 header compilation batches, both memory-record export modes (unpatched names and packaged NIDstCMhTh7h8D4/UTumVjeIQtg), charmap checks and the packaged-library loader.The fixture verifies in both modes that the created record has a null
userand all three callbacks, that the record's ownalloc/realloc/freecallbacks round-trip a block (realloc preserves the written prefix, free accepts the moved block), that destroying the record and destroying null are both accepted, and that 256 create/use/destroy cycles complete without interference.No full application/test-suite, macOS, title or physical-console run is claimed.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T09:39:57Z.
Review: APPROVED
Reviewed exact head
6aea55b3db687ba4c8ce7d24c12837cf2ad5d3b1.FT_New_Memoryconstructs the 32-byte callback record with null user context, andFT_Done_Memorypairs its allocation withfree; the callback signatures and allocator behavior match the cited FreeType memory-record contract. The test exercises unpatched and packaged-NID entry points, callback wiring, allocate/reallocate/free, repeated create/destroy, and null destruction. Hosted Windows passed; the author reports 70/70 focused CTests on Windows and WSL. The PR is clean/mergeable with currentmain, and I found no blocking issue in the exact diff. Console equivalence remains unverified as documented in technical debt; no console run is claimed.