diff options
author | Nico Weber <thakis@chromium.org> | 2013-08-28 20:29:02 (GMT) |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2013-08-28 20:37:12 (GMT) |
commit | 9940196d57d46eb8aeb1cc28a57dee290034fccf (patch) | |
tree | 29c816c838eb036627e31aa6a4ccc901ef5b7c63 /src/deps_log.h | |
parent | d63bd546242c26bb7c8de9da8939d75947461fee (diff) | |
download | Ninja-9940196d57d46eb8aeb1cc28a57dee290034fccf.zip Ninja-9940196d57d46eb8aeb1cc28a57dee290034fccf.tar.gz Ninja-9940196d57d46eb8aeb1cc28a57dee290034fccf.tar.bz2 |
Deps log format v3
This fixes two bugs.
1.) It makes the record size field 4 byte instead of 2, and allows a max
record size of 512kB. This fixes #605, ninja "only" supporting 8k
dependencies per file -- 512kB have room for 128k dependencies. (If that's
still not enough, the current design can support at least 4x that if the
constant is tweaked.)
2.) It makes all records 4-byte aligned, which is probably needed to make the
`reinterpret_cast<int*>(buf)` work on SPARC (cf issue #481), and it's
generally nicer too. (Since there's already one reinterpret_cast, convert
a memcpy() to reinterpret_cast in another branch too).
Diffstat (limited to 'src/deps_log.h')
-rw-r--r-- | src/deps_log.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/deps_log.h b/src/deps_log.h index 47ade03..babf828 100644 --- a/src/deps_log.h +++ b/src/deps_log.h @@ -50,9 +50,10 @@ struct State; /// A dependency list maps an output id to a list of input ids. /// /// Concretely, a record is: -/// two bytes record length, high bit indicates record type -/// (implies max record length 32k) -/// path records contain the string name of the path, followed by the +/// four bytes record length, high bit indicates record type +/// (but max record sizes are capped at 512kB) +/// path records contain the string name of the path, followed by up to 3 +/// padding bytes to align on 4 byte boundaries, followed by the /// one's complement of the expected index of the record (to detect /// concurrent writes of multiple ninja processes to the log). /// dependency records are an array of 4-byte integers |