LLVM  7.0.0svn
llvm::CachePruningPolicy Struct Reference

Policy for the pruneCache() function. More...

#include "llvm/Support/CachePruning.h"

Collaboration diagram for llvm::CachePruningPolicy:
[legend]

## Public Attributes

llvm::Optional< std::chrono::seconds > Interval = std::chrono::seconds(1200)
The pruning interval. More...

std::chrono::seconds Expiration = std::chrono::hours(7 * 24)
The expiration for a file. More...

unsigned MaxSizePercentageOfAvailableSpace = 75
The maximum size for the cache directory, in terms of percentage of the available space on the the disk. More...

uint64_t MaxSizeBytes = 0
The maximum size for the cache directory in bytes. More...

uint64_t MaxSizeFiles = 1000000
The maximum number of files in the cache directory. More...

## Detailed Description

Policy for the pruneCache() function.

A default constructed CachePruningPolicy provides a reasonable default policy.

Definition at line 27 of file CachePruning.h.

## ◆ Expiration

 std::chrono::seconds llvm::CachePruningPolicy::Expiration = std::chrono::hours(7 * 24)

The expiration for a file.

When a file hasn't been accessed for Expiration seconds, it is removed from the cache. A value of 0 disables the expiration-based pruning.

Definition at line 37 of file CachePruning.h.

Referenced by llvm::parseCachePruningPolicy(), and llvm::pruneCache().

## ◆ Interval

 llvm::Optional llvm::CachePruningPolicy::Interval = std::chrono::seconds(1200)

The pruning interval.

This is intended to be used to avoid scanning the directory too often. It does not impact the decision of which file to prune. A value of 0 forces the scan to occur. A value of None disables pruning.

Definition at line 32 of file CachePruning.h.

Referenced by llvm::parseCachePruningPolicy(), and llvm::pruneCache().

## ◆ MaxSizeBytes

 uint64_t llvm::CachePruningPolicy::MaxSizeBytes = 0

The maximum size for the cache directory in bytes.

A value over the amount of available space on the disk will be reduced to the amount of available space. A value of 0 disables the absolute size-based pruning.

Definition at line 49 of file CachePruning.h.

Referenced by llvm::parseCachePruningPolicy(), and llvm::pruneCache().

## ◆ MaxSizeFiles

 uint64_t llvm::CachePruningPolicy::MaxSizeFiles = 1000000

The maximum number of files in the cache directory.

A value of 0 disables the number of files based pruning.

This defaults to 1000000 because with that many files there are diminishing returns on the effectiveness of the cache, and some file systems have a limit on how many files can be contained in a directory (notably ext4, which is limited to around 6000000 files).

Definition at line 58 of file CachePruning.h.

Referenced by llvm::parseCachePruningPolicy(), and llvm::pruneCache().

## ◆ MaxSizePercentageOfAvailableSpace

 unsigned llvm::CachePruningPolicy::MaxSizePercentageOfAvailableSpace = 75

The maximum size for the cache directory, in terms of percentage of the available space on the the disk.

Set to 100 to indicate no limit, 50 to indicate that the cache size will not be left over half the available disk space. A value over 100 will be reduced to 100. A value of 0 disables the percentage size-based pruning.

Definition at line 44 of file CachePruning.h.

Referenced by llvm::parseCachePruningPolicy(), and llvm::pruneCache().

The documentation for this struct was generated from the following file: