23 #include "precompiled.h"
46 shared_ptr<u8> newData;
73 memcpy(
m_data.get()+offset, data, size);
85 const size_t misalignment = (size_t)(ofs -
m_alignedOfs);
void * rtl_AllocateAligned(size_t size, size_t align)
static const size_t BLOCK_SIZE
static const size_t pageSize
void Append(const void *data, size_t size)
void Reserve(size_t size)
static const uintptr_t maxSectorSize
void Flush() const
zero-initialize any remaining space in the align buffer and write it to the file. ...
bool IsAligned(T t, uintptr_t multiple)
Status WriteBlock() const
void Overwrite(const void *data, size_t size, size_t offset)
void EnsureSufficientCapacity(size_t size)
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
T round_up_to_pow2(T x)
round up to next larger power of two.
shared_ptr< u8 > m_alignedBuf
UnalignedWriter(const PFile &file, off_t ofs)
T round_down(T n, T multiple)
i64 Status
Error handling system.
static Status AllocateAligned(shared_ptr< T > &p, size_t size, size_t alignment=cacheLineSize)
#define THROW_STATUS_IF_ERR(expression)
Status Append(const u8 *data, size_t size) const
add data to the align buffer, writing it out to disk if full.
#define RETURN_STATUS_IF_ERR(expression)
static Status Run(const Operation &op, const Parameters &p=Parameters(), const CompletedHook &completedHook=CompletedHook(), const IssueHook &issueHook=IssueHook())