Skip to content

Commit dae5dc5

Browse files
wan9chiclaude
andcommitted
refactor(fspy): own macOS shared-memory mapping
Co-authored-by: GPT-5.6 <gpt-5.6@openai.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent c21af71 commit dae5dc5

6 files changed

Lines changed: 330 additions & 199 deletions

File tree

Cargo.lock

Lines changed: 8 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ serde = "1.0.219"
123123
serde_json = "1.0.140"
124124
serde_norway = "0.9.42"
125125
sha2 = "0.11.0"
126-
shared_memory = "0.12.4"
127126
shell-escape = "0.1.5"
128127
similar = "3.0.0"
129128
smallvec = { version = "2.0.0-alpha.12", features = ["std"] }

crates/fspy_shared/src/ipc/channel/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl Deref for Sender {
118118
}
119119

120120
#[cfg_attr(
121-
not(target_os = "linux"),
121+
target_os = "windows",
122122
expect(
123123
clippy::non_send_fields_in_send_ty,
124124
reason = "`Sender` holds a shared file lock that ensures there's no reader, so `shm` can be safely written to"
@@ -139,7 +139,7 @@ pub struct Receiver {
139139
}
140140

141141
#[cfg_attr(
142-
not(target_os = "linux"),
142+
target_os = "windows",
143143
expect(
144144
clippy::non_send_fields_in_send_ty,
145145
reason = "Receiver doesn't read or write `shm`. It only passes it to `ReceiverLockGuard` under the lock"

crates/fspy_shm/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ license.workspace = true
77
publish = false
88
rust-version.workspace = true
99

10-
[target.'cfg(not(any(target_os = "linux", target_os = "windows")))'.dependencies]
11-
shared_memory = { workspace = true, features = ["logging"] }
12-
1310
[target.'cfg(target_os = "linux")'.dependencies]
1411
base64 = { workspace = true }
1512
memmap2 = { workspace = true }
@@ -19,6 +16,11 @@ tokio-util = { workspace = true }
1916
tracing = { workspace = true }
2017
uuid = { workspace = true, features = ["v4"] }
2118

19+
[target.'cfg(target_os = "macos")'.dependencies]
20+
memmap2 = { workspace = true }
21+
rustix = { workspace = true, features = ["fs", "param", "shm"] }
22+
uuid = { workspace = true, features = ["v4"] }
23+
2224
[target.'cfg(target_os = "windows")'.dependencies]
2325
base64 = { workspace = true }
2426
uuid = { workspace = true, features = ["v4"] }

0 commit comments

Comments
 (0)