Support transmutes requiring fix-up

Open
#3,714 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
compilers

Research direction

The issue discusses extending zerocopy's transmutation capabilities to support fix-up operations for kernel use. Start by reviewing the existing transmute implementations in the codebase, likely in src/lib.rs or related modules. Understand the kernel use case mentioned with Zircon. Look for prior discussions or similar feature requests to gauge the required design work. 'Done' would be a design proposal or implementation that allows transmutes with fix-up steps.

Written by the indexing model from the issue text.

Description

customer-request

A common kernel technique is allocate objects by transmuting them from other, already-allocated-but-no-longer-needed objects which share similar bit validity or logical initialization state. The transmute might not be zero-cost, as there might be some fix-up required, but it still saves a lot of instruction cycles compared to complete from-scratch initialization.

This suggests a generalization of T -> U transmutation: transmutation which requires some number of fix-up operations. If we could support this generalization, it could be used in-kernel.

This came up in discussion with the Zircon kernel folks.

Dominant language
Rust
Stars
2.6k
Forks
194
Avg merge
18h 15m
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/zerocopy

All issues in google/zerocopy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.