mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 13:43:04 +00:00
Remove args cleanup code.
As of 91c3eee173
, the global ARGC and ARGV
no longer reference dynamically-allocated memory, so they don't need to
be cleaned up.
This commit is contained in:
parent
64d171b8a4
commit
46010c4618
@ -14,11 +14,6 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) {
|
||||
imp::init(argc, argv)
|
||||
}
|
||||
|
||||
/// One-time global cleanup.
|
||||
pub unsafe fn cleanup() {
|
||||
imp::cleanup()
|
||||
}
|
||||
|
||||
/// Returns the command line arguments
|
||||
pub fn args() -> Args {
|
||||
imp::args()
|
||||
@ -127,12 +122,6 @@ mod imp {
|
||||
init_wrapper
|
||||
};
|
||||
|
||||
pub unsafe fn cleanup() {
|
||||
let _guard = LOCK.lock();
|
||||
ARGC.store(0, Ordering::Relaxed);
|
||||
ARGV.store(ptr::null_mut(), Ordering::Relaxed);
|
||||
}
|
||||
|
||||
pub fn args() -> Args {
|
||||
Args { iter: clone().into_iter() }
|
||||
}
|
||||
@ -159,8 +148,6 @@ mod imp {
|
||||
|
||||
pub unsafe fn init(_argc: isize, _argv: *const *const u8) {}
|
||||
|
||||
pub fn cleanup() {}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn args() -> Args {
|
||||
use crate::os::unix::prelude::*;
|
||||
|
@ -123,7 +123,6 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) {
|
||||
// SAFETY: must be called only once during runtime cleanup.
|
||||
// NOTE: this is not guaranteed to run, for example when the program aborts.
|
||||
pub unsafe fn cleanup() {
|
||||
args::cleanup();
|
||||
stack_overflow::cleanup();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user