diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 20:05:34 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 20:05:34 +0000 |
commit | 90c7aa0fe476246b74608e564ea09f0d2a4951da (patch) | |
tree | d4d0c7114c09a537f3493efe866a1e6a7f74a944 /net/disk_cache/disk_format.h | |
parent | 6d1ef0ff8c7debfd17d00a2c2649f853231d50d8 (diff) | |
download | chromium_src-90c7aa0fe476246b74608e564ea09f0d2a4951da.zip chromium_src-90c7aa0fe476246b74608e564ea09f0d2a4951da.tar.gz chromium_src-90c7aa0fe476246b74608e564ea09f0d2a4951da.tar.bz2 |
New disk cache eviction algorithm (partial implementation).
Disabled by a #def. When enabled, file format 2.1 is used,
with a possible update from ver 2.0. If a version with this
code disabled is run after the upgrade, it will just
discard the file and go back to 2.0.
We now put some of those extra list to use! Entries are
separated into various lists depending on how often are
used, and we keep track of previously evicted entries.
If the new algorithm is not enabled, most of the code just
goes through a different path (with the old code instead of
the new one). One notable exception is OpenFollowingEntry,
used to enumerate the entries on the cache; the code changed
significantly to support the new version of the "cache
iterator", but functionally should do the same as the current
code.
Review URL: http://codereview.chromium.org/27345
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/disk_format.h')
-rw-r--r-- | net/disk_cache/disk_format.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/disk_cache/disk_format.h b/net/disk_cache/disk_format.h index 7dc2e7c..f089d7b 100644 --- a/net/disk_cache/disk_format.h +++ b/net/disk_cache/disk_format.h @@ -52,8 +52,8 @@ // being currently used, it means that the entry was not properly closed on a // previous run, so it is discarded. -#ifndef NET_DISK_CACHE_DISK_FORMAT_H__ -#define NET_DISK_CACHE_DISK_FORMAT_H__ +#ifndef NET_DISK_CACHE_DISK_FORMAT_H_ +#define NET_DISK_CACHE_DISK_FORMAT_H_ #include "base/basictypes.h" @@ -66,12 +66,14 @@ const uint32 kIndexMagic = 0xC103CAC3; const uint32 kCurrentVersion = 0x20000; // Version 2.0. struct LruData { + int32 pad1[3]; + int32 sizes[5]; CacheAddr heads[5]; CacheAddr tails[5]; CacheAddr transaction; // In-flight operation target. int32 operation; // Actual in-flight operation. int32 operation_list; // In-flight operation list. - int32 pad[7]; + int32 pad2[7]; }; // Header for the master index file. @@ -86,7 +88,7 @@ struct IndexHeader { int32 table_len; // Actual size of the table (0 == kIndexTablesize). int32 crash; // Signals a previous crash. int32 experiment; // Id of an ongoing test. - int32 pad[62]; + int32 pad[54]; LruData lru; // Eviction control data. IndexHeader() { memset(this, 0, sizeof(*this)); @@ -188,5 +190,5 @@ COMPILE_ASSERT(sizeof(BlockFileHeader) == kBlockHeaderSize, bad_header); } // namespace disk_cache -#endif // NET_DISK_CACHE_DISK_FORMAT_H__ +#endif // NET_DISK_CACHE_DISK_FORMAT_H_ |