feat(libSceIcu): implement the uprv allocation and string duplication… #17231
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17231"
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 JoanNugroho on 2026-11-08T15:48:22Z.
What
Implements
uprv_malloc,uprv_realloc,uprv_strdupanduprv_strndupin libSceIcu. They were parameterless throwing placeholders inLegacyExports.cpp.github.com/unicode-org/icu@049e0d6a42/icu4c/source/common/cmemory.cpp) and [cstring.cpp](github.com/unicode-org/icu@049e0d6a42/icu4c/source/common/cstring.cpp), the revision the other libSceIcu entries already cite.uprv_realloctreats that block as unallocated, and a resize of any other block to zero releases it and returns the shared block.u_setMemoryFunctionsare called with their context when set. Otherwise the blocks come from libc's guest heap, so a title releases them withfree; the module exports nouprv_free.uprv_strndupcopies exactlynbytes, past a NUL, and a negativenduplicates the whole string. A null source throws where ICU faults.Memory function configurationdebt entry no longer says that nothing calls the stored callbacks, and a new entry records what stays unverified.Tested
x86_64-ucrt-posix-sehr7, the CI toolchain):guest_icu_configurationpasses, and all 26icutests pass (ctest -R icu).Configuration.cppand the test compiled with libc'sApplicationHeap,ApplicationProcessParameters,GuestHeap,GuestArenaandGuestAllocationssources pass under UBSan and at-O2.core/libs/tests/test_public_headers.py --audit-onlyandtools/check_conventions.pypass.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](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QMWStysvjPgmgkKvPWyX1b
Pull request closed