Skip to content

Commit

Permalink
Use a10::io::Std{io,out,err}
Browse files Browse the repository at this point in the history
Fixes the leaking of a10::SubmissionQueue. Also avoids the use of some
unsafe.
  • Loading branch information
Thomasdezeeuw committed Jul 12, 2023
1 parent 1105b96 commit 3f818a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ edition = "2021"
test = ["heph/test"]

[dependencies]
a10 = { version = "0.1.0", default-features = false, features = ["nightly"] }
a10 = { version = "0.1.1", default-features = false, features = ["nightly"] }
heph = { version = "0.5.0", path = "../", default-features = false }
heph-inbox = { version = "0.2.3", path = "../inbox", default-features = false }
log = { version = "0.4.17", default-features = false, features = ["kv_unstable", "kv_unstable_std"] }
Expand Down
6 changes: 2 additions & 4 deletions rt/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ macro_rules! stdio {
) => {
#[doc = concat!("Create a new `", stringify!($name), "`.\n\n")]
pub fn $fn<RT: Access>(rt: &RT) -> $name {
let fd = std::mem::ManuallyDrop::new(unsafe {
a10::AsyncFd::from_raw_fd($fd, rt.submission_queue())
});
let fd = a10::io::$fn(rt.submission_queue());
$name { fd }
}

Expand All @@ -81,7 +79,7 @@ macro_rules! stdio {
)]
#[derive(Debug)]
pub struct $name {
fd: std::mem::ManuallyDrop<a10::AsyncFd>,
fd: a10::io::$name,
}
};
}
Expand Down

0 comments on commit 3f818a6

Please sign in to comment.