| commit | 1980fdb095d375bb94d8bda79d24d927156a1d81 | [log] [tgz] |
|---|---|---|
| author | Googler <noreply@google.com> | Tue Sep 01 13:49:34 2020 -0700 |
| committer | Copybara-Service <copybara-worker@google.com> | Tue Sep 01 13:50:48 2020 -0700 |
| tree | 880eef536b18ebe80709b2bfc6ee12b15fcdf8e6 | |
| parent | b48b7064c4104a70626832aeb024e17a22a13ac7 [diff] |
Simplify memory management for RcFile. RcFile uses pointers to avoid copying the source paths, which leads to some very tricky gotchas in the code. This change converts the pointers to integer indices, which are stable and easier to work with. It adds a tiny bit of overhead when using those indices, but makes the entire class much easier to work with. Note: This change makes it theoretically possible to replace the unique_ptr in RcFile::Parse with a simpler type like std::optional, but that requires C++17 which Bazel's build doesn't currently support. There's a C++11 compatible version in absl, but that requires bringing in that extra dependency which would need to be done separately. For now, I couldn't think of a better way to handle it than leaving it a unique_ptr. RELNOTES: none PiperOrigin-RevId: 329574479
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md