mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
20 lines
518 B
C++
20 lines
518 B
C++
|
/*
|
||
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
* Copyright (C) 2022 Raspberry Pi Ltd
|
||
|
*/
|
||
|
|
||
|
#include "devicewrapperblockcacheentry.h"
|
||
|
#include <QObject>
|
||
|
|
||
|
DeviceWrapperBlockCacheEntry::DeviceWrapperBlockCacheEntry(QObject *parent, size_t blocksize)
|
||
|
: QObject(parent), dirty(false)
|
||
|
{
|
||
|
/* Windows requires buffers to be 4k aligned when reading/writing raw disk devices */
|
||
|
block = (char *) qMallocAligned(blocksize, 4096);
|
||
|
}
|
||
|
|
||
|
DeviceWrapperBlockCacheEntry::~DeviceWrapperBlockCacheEntry()
|
||
|
{
|
||
|
qFreeAligned(block);
|
||
|
}
|