Repository navigation
feat(libc): wire the collate<char> facet vtable - #11166
Conversation
The nine-slot _ZTVSt7collateIcE export added by boykopovar#9979 was still zeroed, so a guest that called through the exported vtable faulted. Fill slots 2 through 8 with the same facet methods that g_collateVtable uses, leave the offset-to-top and typeinfo slots zero, and cover compare, transform, hash, retain and release through the exported object.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head c66f61ff5259e3d05eab0e35c99b948d2b62903b.
The exported nine-slot object points at the same collate methods as the existing facet vtable, leaves offset-to-top/typeinfo zero as documented, and the test invokes all populated slots through the exported object. The debt update correctly records the remaining RTTI limitation and the evidence boundary.
Checks: git diff --check upstream/main...HEAD passes and the conventions, eligibility, intake, labels and report checks pass. The author reports guest_locale_tests and guest_locale passing locally. The current hosted relinker and register-context jobs pass; macOS relinker/register-context and write-watch jobs are still queued, while the general Linux/Windows jobs are skipped by the path policy. I did not run a local build in this review.
|
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.
|
|
Follow-up to my review: the remaining hosted checks have completed. Linux/macOS/Windows relinker, ASan, Linux Debug/Release and macOS Intel Debug/Release register-context, and macOS write-watch jobs pass. Full Linux and Windows product jobs are skipped by the repository path policy. |
|
I manually checked the current overlap warnings. #10158 adds |
|
Windows run of head
AI-assisted: yes (Claude Code); results above were run on this machine. |
|
Merge-order follow-up on the overlap: #10158 and #10200 add the distinct adjacent |
|
All checks are now green on |
|
@00xDisaster Thanks for checking the merge with #10158 and #10200. That order works for us: this one first, then those two rebase and keep all three declarations and their tests. The Linux and Windows product jobs were path-skipped on this head, so we'll still run those before it goes in. |
What
Fill the exported
collate<char>vtable with the facet methods that already backg_collateVtable. #9979 added the nine-slot_ZTVSt7collateIcE_nid_postfixdata object (NIDruZtIwbCFjk) with the console's 72-byte layout, but every slot was zero, so a title that calledcompare,transformorhashthrough the exported vtable faulted. Slots 2 through 8 now holdDestroyCollate,DeleteCollate,RetainFacet,ReleaseFacet,CollateCompare,CollateTransformandCollateHash; slots 0 and 1 stay zero for offset-to-top and typeinfo, as they were._Getcatstill installsg_collateVtable, so both the exported object and facets built by_Getcatcall the same implementations.The exported object is still writable data and supplies no RTTI typeinfo; the debt entry records both. This does not touch
time_putornum_put: open #11044 and #11054 implement those different virtuals, and no open PR currently fills this array. #10158 and #10200 add the distinct adjacentmessagesandnumpunctvtable declarations in the sameLocaleSupport.cppblock; both are currentlyCONFLICTING, so this PR merges first and they rebase afterwards, keeping all three declarations. No dependency is required.Tested
Linux CachyOS 7.3.0-4-cachyos, GCC 16.2.1. Base
upstream/main74ac0e7912a5eaa453fff872f4d4fe803154b08c; headc66f61ff5259e3d05eab0e35c99b948d2b62903b.cmake --build build --target guest_locale_tests --parallel: passed.ctest --test-dir build -R '^guest_locale$' --output-on-failure: 1/1 passed.guest_localenow callscompare,transform,hash,retainandreleasethrough&_ZTVSt7collateIcE_nid_postfix[2], checks the compare ordering and FNV hash result, and checks that slots 0 and 1 remain zero while slots 2 through 8 are non-null.tools/check_conventions.py --base upstream/main --head HEADandgit diff --check: clean.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)