Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LockedBox use examples #99

Open
solkitten opened this issue Jan 19, 2023 · 0 comments
Open

LockedBox use examples #99

solkitten opened this issue Jan 19, 2023 · 0 comments

Comments

@solkitten
Copy link

solkitten commented Jan 19, 2023

Could you please give some examples how to use LockedBox?
I have a code like this:

#[repr(C, packed)]
#[derive(Debug, Clone, Copy, DeviceCopy)]
pub struct SomeResult {
    pub field: u32
}
...
let mut some_result = SomeResult::default();
let mut lb_some_result = LockedBox::new(&some_result).unwrap();

What should I do to copy it to DeviceBox and back from DeviceBox after the kernel finishes? Things like
let dev_results = DeviceBox::new(&lb_some_result).unwrap();
are not working.

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

No branches or pull requests

1 participant