Skip to content

Comments

Support shm interface#75

Closed
bkoropoff wants to merge 2 commits intoorbitinghail:mainfrom
bkoropoff:shm-mark2
Closed

Support shm interface#75
bkoropoff wants to merge 2 commits intoorbitinghail:mainfrom
bkoropoff:shm-mark2

Conversation

@bkoropoff
Copy link
Contributor

This requires a new associated type for mapped pages/regions. It can
set to something trivial like [u8; 0] if unused.

The lifetime semantics of returned mapped regions are odd: the regions
are cached until all being released at once with xShmUnmap. In order
to present a safe interface to Rust, the region handles are kept in
boxes (for address stability) in a Vec and then dropped all at once.
I'm still considering whether a more efficient design is possible
without resorting to unsafe trait methods.

This requires a new associated type for mapped pages/regions.  It can
set to something trivial like [u8; 0] if unused.

The lifetime semantics of returned mapped regions are odd: the regions
are cached until all being released at once with `xShmUnmap`. In order
to present a safe interface to Rust, the region handles are kept in
boxes (for address stability) in a `Vec` and then dropped all at once.
I'm still considering whether a more efficient design is possible
without restoring to `unsafe` trait methods.
@bkoropoff bkoropoff closed this Feb 24, 2026
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