diff options
author | Nico Weber <thakis@chromium.org> | 2014-05-25 04:17:35 (GMT) |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2014-06-15 21:13:17 (GMT) |
commit | 945a1080afc7f79d50e166428af754a3e5d5d91c (patch) | |
tree | c36bd3936b0f9e7576aaef7fec95af254f4f9b06 /src/disk_interface.h | |
parent | 0ac72f01630bbca087cdb41a89ca4d80b659b536 (diff) | |
download | Ninja-945a1080afc7f79d50e166428af754a3e5d5d91c.zip Ninja-945a1080afc7f79d50e166428af754a3e5d5d91c.tar.gz Ninja-945a1080afc7f79d50e166428af754a3e5d5d91c.tar.bz2 |
Add a stat cache. Demo-quality, and disabled atm.
Diffstat (limited to 'src/disk_interface.h')
-rw-r--r-- | src/disk_interface.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/disk_interface.h b/src/disk_interface.h index ff1e21c..d368c38 100644 --- a/src/disk_interface.h +++ b/src/disk_interface.h @@ -15,6 +15,7 @@ #ifndef NINJA_DISK_INTERFACE_H_ #define NINJA_DISK_INTERFACE_H_ +#include <map> #include <string> using namespace std; @@ -55,7 +56,7 @@ struct DiskInterface { /// Implementation of DiskInterface that actually hits the disk. struct RealDiskInterface : public DiskInterface { - RealDiskInterface() : quiet_(false) {} + RealDiskInterface() : quiet_(false), use_cache_(false) {} virtual ~RealDiskInterface() {} virtual TimeStamp Stat(const string& path); virtual bool MakeDir(const string& path); @@ -65,6 +66,12 @@ struct RealDiskInterface : public DiskInterface { /// Whether to print on errors. Used to make a test quieter. bool quiet_; + /// Whether stat information can be cached. + bool use_cache_; + + typedef map<string, TimeStamp> DirCache; + typedef map<string, DirCache*> Cache; + Cache cache_; }; #endif // NINJA_DISK_INTERFACE_H_ |