]> git.lizzy.rs Git - rust.git/blobdiff - src/machine.rs
env shim: make sure we clean up all the memory we allocate
[rust.git] / src / machine.rs
index 73e7ce665b85857331477854e66669c206536379..a530ef66d384e16948781e3b76ac37cd602a02e2 100644 (file)
@@ -48,9 +48,13 @@ pub enum MiriMemoryKind {
     C,
     /// Windows `HeapAlloc` memory.
     WinHeap,
-    /// Memory for env vars and args, errno, extern statics and other parts of the machine-managed environment.
+    /// Memory for args, errno, extern statics and other parts of the machine-managed environment.
+    /// This memory may leak.
     Machine,
+    /// Memory for env vars. Separate from `Machine` because we clean it up and leak-check it.
+    Env,
     /// Globals copied from `tcx`.
+    /// This memory may leak.
     Global,
 }
 
@@ -484,7 +488,7 @@ impl MayLeak for MiriMemoryKind {
     fn may_leak(self) -> bool {
         use self::MiriMemoryKind::*;
         match self {
-            Rust | C | WinHeap => false,
+            Rust | C | WinHeap | Env => false,
             Machine | Global => true,
         }
     }