LLVM 22.0.0git
|
Sink for data. More...
#include "llvm/CAS/OnDiskDataAllocator.h"
Classes | |
struct | ImplType |
class | OnDiskPtr |
A pointer to data stored on disk. More... |
Public Types | |
using | ValueProxy = MutableArrayRef<char> |
Public Member Functions | |
Expected< ArrayRef< char > > | get (FileOffset Offset, size_t Size) const |
Get the data of Size stored at the given Offset . | |
Expected< OnDiskPtr > | allocate (size_t Size) |
Allocate at least Size with 8-byte alignment. | |
MutableArrayRef< uint8_t > | getUserHeader () |
size_t | size () const |
size_t | capacity () const |
OnDiskDataAllocator (OnDiskDataAllocator &&RHS) | |
OnDiskDataAllocator & | operator= (OnDiskDataAllocator &&RHS) |
OnDiskDataAllocator (const OnDiskDataAllocator &)=delete | |
OnDiskDataAllocator & | operator= (const OnDiskDataAllocator &)=delete |
~OnDiskDataAllocator () |
Static Public Member Functions | |
static Expected< OnDiskDataAllocator > | create (const Twine &Path, const Twine &TableName, uint64_t MaxFileSize, std::optional< uint64_t > NewFileInitialSize, uint32_t UserHeaderSize=0, function_ref< void(void *)> UserHeaderInit=nullptr) |
Sink for data.
Stores variable length data with 8-byte alignment. Does not track size of data, which is assumed to known from context, or embedded. Uses 0-padding but does not guarantee 0-termination.
Definition at line 29 of file OnDiskDataAllocator.h.
Definition at line 31 of file OnDiskDataAllocator.h.
|
default |
References OnDiskDataAllocator(), and RHS.
Referenced by OnDiskDataAllocator(), OnDiskDataAllocator(), operator=(), and operator=().
|
delete |
References OnDiskDataAllocator().
|
default |
Expected< OnDiskDataAllocator::OnDiskPtr > OnDiskDataAllocator::allocate | ( | size_t | Size | ) |
Allocate at least Size
with 8-byte alignment.
Definition at line 213 of file OnDiskDataAllocator.cpp.
References llvm::createStringError(), llvm::make_error_code(), and Size.
size_t OnDiskDataAllocator::capacity | ( | ) | const |
Definition at line 227 of file OnDiskDataAllocator.cpp.
|
static |
Definition at line 204 of file OnDiskDataAllocator.cpp.
References llvm::createStringError(), and llvm::make_error_code().
Expected< ArrayRef< char > > OnDiskDataAllocator::get | ( | FileOffset | Offset, |
size_t | Size ) const |
Get the data of Size
stored at the given Offset
.
Note the allocator doesn't keep track of the allocation size, thus Size
doesn't need to match the size of allocation but needs to be smaller.
Definition at line 218 of file OnDiskDataAllocator.cpp.
References llvm::createStringError(), llvm::make_error_code(), llvm::Offset, and Size.
MutableArrayRef< uint8_t > OnDiskDataAllocator::getUserHeader | ( | ) |
create
time, with size UserHeaderSize
. Definition at line 224 of file OnDiskDataAllocator.cpp.
|
delete |
References OnDiskDataAllocator().
|
default |
References OnDiskDataAllocator(), and RHS.
size_t OnDiskDataAllocator::size | ( | ) | const |
Definition at line 226 of file OnDiskDataAllocator.cpp.