Skip to content

refactor(fspy-shm): adopt the no-std OsCStr API - #668

Merged
wan9chi merged 1 commit into
agent/fspy-shm-extract-keeperfrom
agent/fspy-shm-nostd-api
Aug 14, 2026
Merged

refactor(fspy-shm): adopt the no-std OsCStr API#668
wan9chi merged 1 commit into
agent/fspy-shm-extract-keeperfrom
agent/fspy-shm-nostd-api

Conversation

@wan9chi

@wan9chi wan9chi commented Aug 14, 2026

Copy link
Copy Markdown
Member

Motivation

With the backing path supplied by the caller (#667), nothing left in fspy_shm needs std: the remaining OsStr/CString/io::Error uses 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_std now: create/open/remove 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 piece consumed immediately:

  • fspy_nostd gains the OsCStr alias and a FatThin 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.

Stack created with GitHub Stacks CLIGive Feedback 💬

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +1.45%  [-11.69% .. +11.86%]  overhead   +52.44%
dynamic/access             change  -0.13%  [-16.33% .. +27.79%]  overhead    +9.55%
dynamic/access-relative    change  -1.52%  [-16.72% ..  +6.29%]  overhead   +47.37%
static/launch              change  +1.21%  [-10.19% .. +16.23%]  overhead  +150.64%
static/access              change  -0.77%  [ -9.36% .. +10.63%]  overhead  +958.61%
static/access-relative     change  +0.08%  [ -4.22% ..  +4.29%]  overhead +1287.92%

macos

dynamic/launch             change  +0.19%  [ -4.17% ..  +5.10%]  overhead  +236.76%
dynamic/access             change  -1.03%  [-59.84% .. +10.11%]  overhead    +0.37%
dynamic/access-relative    change  +0.40%  [ -8.18% .. +86.07%]  overhead  +263.40%

windows

dynamic/launch             change  -0.15%  [ -3.96% ..  +3.45%]  overhead   +26.75%
dynamic/access             change  +0.00%  [ -2.50% ..  +4.51%]  overhead    +1.87%
dynamic/access-relative    change  +0.18%  [ -1.58% ..  +1.81%]  overhead    +1.58%

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
wan9chi force-pushed the agent/fspy-shm-nostd-api branch from 453b8c3 to 4b8ec57 Compare August 14, 2026 01:56
@wan9chi
wan9chi marked this pull request as ready for review August 14, 2026 03:14
@wan9chi
wan9chi merged commit 8ba51c6 into main Aug 14, 2026
19 checks passed
@wan9chi
wan9chi deleted the agent/fspy-shm-nostd-api branch August 14, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant