diff options
author | 2017-05-02 14:23:36 +0200 | |
---|---|---|
committer | 2017-05-02 15:44:33 +0200 | |
commit | 7beadb7277453efec7e12b925005e7f0e003b592 (patch) | |
tree | ab5ebab351566289fb5f0f1f44023c8b038f40e9 /src/main/java/com/google/devtools/build/lib/pkgcache | |
parent | adb15a606e42dc4feac03353c8b2587c5d3c78c6 (diff) |
Automated g4 rollback of commit 38b835097f9ae9a6062172b8a33ec2e2d1edde20.
*** Reason for rollback ***
Breaking Bazel build on linux, see http://ci.bazel.io/job/bazel-tests/733/
Repro: bazel build //src/test/java/com/google/devtools/build/lib:packages_test
Found by bisecting.
*** Original change description ***
Only allocate some formerly frequently allocated PathFragment objects once.
This reduces both gc churn and retained memory usage.
RELNOTES: None
PiperOrigin-RevId: 154821457
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/pkgcache')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/pkgcache/PathPackageLocator.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/PathPackageLocator.java b/src/main/java/com/google/devtools/build/lib/pkgcache/PathPackageLocator.java index 223b0c4483..f828538419 100644 --- a/src/main/java/com/google/devtools/build/lib/pkgcache/PathPackageLocator.java +++ b/src/main/java/com/google/devtools/build/lib/pkgcache/PathPackageLocator.java @@ -45,7 +45,6 @@ import java.util.concurrent.atomic.AtomicReference; * filesystem) idempotent. */ public class PathPackageLocator implements Serializable { - private static final PathFragment BUILD_PATH_FRAGMENT = PathFragment.create("BUILD"); public static final ImmutableSet<String> DEFAULT_TOP_LEVEL_EXCLUDES = ImmutableSet.of("experimental"); @@ -102,8 +101,7 @@ public class PathPackageLocator implements Serializable { AtomicReference<? extends UnixGlob.FilesystemCalls> cache) { Preconditions.checkArgument(!packageIdentifier.getRepository().isDefault()); if (packageIdentifier.getRepository().isMain()) { - return getFilePath( - packageIdentifier.getPackageFragment().getRelative(BUILD_PATH_FRAGMENT), cache); + return getFilePath(packageIdentifier.getPackageFragment().getRelative("BUILD"), cache); } else { Verify.verify(outputBase != null, String.format( "External package '%s' needs to be loaded but this PathPackageLocator instance does not " @@ -113,7 +111,7 @@ public class PathPackageLocator implements Serializable { // is true for the invocation in GlobCache, but not for the locator.getBuildFileForPackage() // invocation in Parser#include(). Path buildFile = outputBase.getRelative( - packageIdentifier.getSourceRoot()).getRelative(BUILD_PATH_FRAGMENT); + packageIdentifier.getSourceRoot()).getRelative("BUILD"); try { FileStatus stat = cache.get().statIfFound(buildFile, Symlinks.FOLLOW); if (stat != null && stat.isFile()) { |