35 , myStorageMode(StorageMode::STORE_ALIGNED)
43 memcpy(myData, other.myData, other.myDataSize*
sizeof(
T));
47 : myData(other.myData)
48 , myDataSize(other.myDataSize)
49 , myStorageMode(other.myStorageMode)
51 other.myData =
nullptr;
60 memcpy(myData, other.myData, other.myDataSize*
sizeof(
T));
97 T *
data()
const {
return myData; }
104 int64 total =
sizeof(*this);
105 total += myDataSize *
sizeof(
T);
112 enum class StorageMode
125 switch (myStorageMode)
131 default:
UT_ASSERT(0 &&
"Unknown storage mode");
140 exint myDataSize = 0;
void adoptFromMalloc(void *data, const exint size)
T * data() const
The buffer data.
void * SYSamalloc(size_t b)
CE_BufferHost(const CE_BufferHost &other)
exint size() const
The size of the buffer data in elements.
int64 getMemoryUsage() const
void adoptFromAlignedMalloc(void *data, const exint size)
CE_BufferHost(CE_BufferHost &&other) noexcept
static constexpr int ALIGNMENT
CE_BufferHost(const exint size)
void adoptFromNew(void *data, const exint size)
CE_BufferHost & operator=(const CE_BufferHost &other)