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:
Dan Gohman 2021-07-17 05:47:39 -07:00
parent 64d171b8a4
commit 46010c4618
2 changed files with 0 additions and 14 deletions

View File

@ -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::*;

View File

@ -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();
}