LLVM: lib/CAS/OnDiskCommon.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_LIB_CAS_ONDISKCOMMON_H
10#define LLVM_LIB_CAS_ONDISKCOMMON_H
11
14#include
15#include
16
18
19
20
22
23
24
25
26
28
29
30
31
33
34
35
36
37
39
40
41
42
44
45
46
47
49
50
51
52
54 int FD, std::chrono::milliseconds Timeout = std::chrono::milliseconds(0),
56
57
58
59
60
61
62
64 size_t NewSize);
65
66
67
68
69
70
72
73}
74
75#endif
#define LLVM_ABI_FOR_TEST
Tagged union holding either a T or a Error.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
constexpr StringLiteral CASFormatVersion
The version for all the ondisk database files.
Definition OnDiskCommon.h:21
LLVM_ABI_FOR_TEST void setMaxMappingSize(uint64_t Size)
Set MaxMappingSize for ondisk CAS.
Expected< std::optional< uint64_t > > getOverriddenMaxMappingSize()
Retrieves an overridden maximum mapping size for CAS files, if any, speicified by LLVM_CAS_MAX_MAPPIN...
std::error_code lockFileThreadSafe(int FD, llvm::sys::fs::LockKind Kind)
Thread-safe alternative to sys::fs::lockFile.
std::error_code unlockFileThreadSafe(int FD)
Thread-safe alternative to sys::fs::unlockFile.
std::error_code tryLockFileThreadSafe(int FD, std::chrono::milliseconds Timeout=std::chrono::milliseconds(0), llvm::sys::fs::LockKind Kind=llvm::sys::fs::LockKind::Exclusive)
Thread-safe alternative to sys::fs::tryLockFile.
Expected< uint64_t > getBootTime()
Get boot time for the OS.
Expected< size_t > preallocateFileTail(int FD, size_t CurrentSize, size_t NewSize)
Allocate space for the file FD on disk, if the filesystem supports it.
bool useSmallMappingSize(const Twine &Path)
Whether to use a small file mapping for ondisk databases created in Path.
LockKind
An enumeration for the lock kind.
@ Timeout
Reached timeout while waiting for the owner to release the lock.