You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Motivation
The shared-memory writer requires unused bytes to start at zero, but `fspy_shm` did not document that guarantee. Document the contract and add cross-platform regression coverage through owner and opened views so backend changes cannot silently violate it.
|`create(size)`| Creates a non-emptymapping and returns its unique owner.|
13
+
|`create(size)`| Creates a non-empty, zero-initialized mapping and returns its unique owner. |
14
14
|`open(id)`| Opens another view of the mapping identified by `id`. |
15
15
|`Shm::id()`| Returns the identifier to send to another process. |
16
16
|`Shm::len()`| Returns the mapped size. |
@@ -19,6 +19,8 @@ The public API is defined in [`src/lib.rs`](src/lib.rs).
19
19
20
20
`Shm` does not synchronize memory access. The fspy channel combines it with atomic frame headers and a lock file. Senders hold a shared file lock while writing. The receiver takes the exclusive lock before reading, which waits for existing senders and rejects new ones.
21
21
22
+
Every byte in a mapping returned by `create` is initially zero. `open` exposes the mapping's current contents and does not reinitialize them.
23
+
22
24
## Ownership semantics
23
25
24
26
`create` returns the only owner. `open` returns non-owning views.
0 commit comments