refactor(fspy-shm): adopt the no-std OsCStr API - #668
Merged
Conversation
fspy benchmarklinuxmacoswindows |
fspy_shm drops std: create/open/remove now take fspy_nostd::OsCStr paths (bytes on Unix, wide units on Windows), create takes NonZeroUsize, and every function returns fspy_nostd::Result with raw OS error codes. Supporting surface, each consumed immediately: - fspy_nostd gains the OsCStr alias and a Fat-to-Thin downgrade. - fspy_nostd_alloc compiles on every platform now that only arena and fs are unix-specific; CString is generic over the code unit, renames its byte accessors to unit accessors, gains a checked from_vec_with_nul, and an OsCString alias mirrors OsCStr. - fspy_shared owns the OsStr boundary: it encodes paths into OsCString, keeps one in its keeper, and maps raw OS errors back to io::Error. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
wan9chi
force-pushed
the
agent/fspy-shm-nostd-api
branch
from
August 14, 2026 01:56
453b8c3 to
4b8ec57
Compare
wan9chi
marked this pull request as ready for review
August 14, 2026 03:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
With the backing path supplied by the caller (#667), nothing left in fspy_shm needs std: the remaining
OsStr/CString/io::Erroruses were adapters at the API boundary. Dropping them makes the crate usable from the preload contexts where std is not dependable, matching fspy_nostd's guarantees.fspy_shm is
no_stdnow:create/open/removetakefspy_nostd::OsCStrpaths (bytes on Unix, wide units on Windows),createtakesNonZeroUsize, and every function returnsfspy_nostd::Resultwith raw OS error codes.Supporting surface, each piece consumed immediately:
OsCStralias and aFat→Thindowngrade.arenaandfsare unix-specific;CStringis generic over the code unit, renames its byte accessors to unit accessors, gains a checkedfrom_vec_with_nul, and anOsCStringalias mirrorsOsCStr.OsStrboundary: it encodes paths intoOsCString, keeps one in its keeper, and maps raw OS errors back toio::Error.Stack created with GitHub Stacks CLI • Give Feedback 💬