OSDN Git Service

ART: Remove unnecessary file from vdex
authorAndreas Gampe <agampe@google.com>
Mon, 12 Sep 2016 22:55:56 +0000 (15:55 -0700)
committerAndreas Gampe <agampe@google.com>
Mon, 12 Sep 2016 23:25:26 +0000 (16:25 -0700)
Don't store the file. The mem-map works without it.

Test: m
Test: m test-art-host
Test: device boots
Bug: 30937355
Bug: 31439377
Change-Id: Ie9579062c20ddd8dcfc612ccb614f0a0553d4fd9

runtime/vdex_file.cc
runtime/vdex_file.h

index 12bc451..a71578b 100644 (file)
@@ -19,6 +19,7 @@
 #include <memory>
 
 #include "base/logging.h"
+#include "base/unix_file/fd_file.h"
 
 namespace art {
 
@@ -81,7 +82,7 @@ VdexFile* VdexFile::Open(const std::string& vdex_filename,
   }
 
   *error_msg = "Success";
-  return new VdexFile(vdex_file.release(), mmap.release());
+  return new VdexFile(mmap.release());
 }
 
 }  // namespace art
index e381eb7..9215e52 100644 (file)
@@ -21,7 +21,6 @@
 #include <string>
 
 #include "base/macros.h"
-#include "base/unix_file/fd_file.h"
 #include "mem_map.h"
 #include "os.h"
 
@@ -66,9 +65,8 @@ class VdexFile {
   size_t Size() const { return mmap_->Size(); }
 
  private:
-  VdexFile(File* file, MemMap* mmap) : file_(file), mmap_(mmap) {}
+  explicit VdexFile(MemMap* mmap) : mmap_(mmap) {}
 
-  std::unique_ptr<File> file_;
   std::unique_ptr<MemMap> mmap_;
 
   DISALLOW_COPY_AND_ASSIGN(VdexFile);