Skip to content

Commit f0aa052

Browse files
committed
Disable vec_into_raw_parts feature
Unify argv and env leaking
1 parent 806ceb0 commit f0aa052

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#![feature(specialization)]
1919
#![feature(core_intrinsics)]
2020
#![feature(alloc_error_handler)]
21-
#![feature(vec_into_raw_parts)]
2221
#![feature(strict_provenance)]
2322
#![feature(is_some_and)]
2423
#![cfg_attr(target_os = "none", no_std)]

src/syscalls/interfaces/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ pub trait SyscallInterface: Send + Sync {
4545
envv.push(core::ptr::null::<u8>());
4646

4747
let argc = argv.len() as i32;
48-
let argv = Box::leak(argv.into_boxed_slice()).as_ptr();
49-
let envv = Box::leak(envv.into_boxed_slice()).as_ptr();
48+
let argv = argv.leak().as_ptr();
49+
let envv = envv.leak().as_ptr();
5050

5151
(argc, argv, envv)
5252
}

src/syscalls/interfaces/uhyve.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ impl SyscallInterface for Uhyve {
174174
);
175175
uhyve_send(UHYVE_PORT_CMDVAL, &mut syscmdval);
176176

177-
let (argv_ptr, _, _) = argv.into_raw_parts();
178-
let (env_ptr, _, _) = env.into_raw_parts();
179-
(syscmdsize.argc, argv_ptr, env_ptr)
177+
let argv = argv.leak().as_ptr();
178+
let env = env.leak().as_ptr();
179+
(syscmdsize.argc, argv, env)
180180
}
181181

182182
fn shutdown(&self, arg: i32) -> ! {

0 commit comments

Comments
 (0)