Skip to content

[llvm][cas] Fix typo in needsGarbageCollection NFC #10398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/include/llvm/CAS/UnifiedOnDiskCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OnDiskKeyValueDB;
/// High-level properties:
/// * While \p UnifiedOnDiskCache is open on a directory, by any process, the
/// storage size in that directory will keep growing unrestricted. For data to
/// become eligible for garbase-collection there should be no open instances
/// become eligible for garbage-collection there should be no open instances
/// of \p UnifiedOnDiskCache for that directory, by any process.
/// * Garbage-collection needs to be triggered explicitly by the client. It can
/// be triggered on a directory concurrently, at any time and by any process,
Expand Down Expand Up @@ -84,7 +84,7 @@ class UnifiedOnDiskCache {

/// This is called implicitly at destruction time, so it is not required for a
/// client to call this. After calling \p close the only method that is valid
/// to call is \p needsGarbaseCollection.
/// to call is \p needsGarbageCollection.
///
/// \param CheckSizeLimit if true it will check whether the primary store has
/// exceeded its intended size limit. If false the check is skipped even if a
Expand All @@ -106,7 +106,7 @@ class UnifiedOnDiskCache {

/// \returns whether there are unused data that can be deleted using a
/// \p collectGarbage call.
bool needsGarbaseCollection() const { return NeedsGarbageCollection; }
bool needsGarbageCollection() const { return NeedsGarbageCollection; }

/// Remove any unused data from the directory at \p Path. If there are no such
/// data the operation is a no-op.
Expand Down
8 changes: 4 additions & 4 deletions llvm/unittests/CAS/UnifiedOnDiskCacheTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ TEST(UnifiedOnDiskCacheTest, Basic) {
reopenDB();

EXPECT_FALSE(UniDB->hasExceededSizeLimit());
EXPECT_FALSE(UniDB->needsGarbaseCollection());
EXPECT_FALSE(UniDB->needsGarbageCollection());

checkRootTree();
checkKey(Key1Hash, "root");
Expand All @@ -154,10 +154,10 @@ TEST(UnifiedOnDiskCacheTest, Basic) {
}
PrevStoreSize = UniDB->getStorageSize();
ASSERT_THAT_ERROR(UniDB->close(), Succeeded());
EXPECT_TRUE(UniDB->needsGarbaseCollection());
EXPECT_TRUE(UniDB->needsGarbageCollection());

reopenDB();
EXPECT_TRUE(UniDB->needsGarbaseCollection());
EXPECT_TRUE(UniDB->needsGarbageCollection());

std::optional<size_t> DirSizeBefore;
ASSERT_THAT_ERROR(countFileSizes(Temp.path()).moveInto(DirSizeBefore),
Expand All @@ -172,7 +172,7 @@ TEST(UnifiedOnDiskCacheTest, Basic) {
EXPECT_LT(*DirSizeAfter, *DirSizeBefore);

reopenDB();
EXPECT_FALSE(UniDB->needsGarbaseCollection());
EXPECT_FALSE(UniDB->needsGarbageCollection());

checkRootTree();
checkKey(Key1Hash, "root");
Expand Down