Add Block::fill
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -92,6 +92,9 @@ public:
|
|||||||
// Copy a range of data to the destination pointer
|
// Copy a range of data to the destination pointer
|
||||||
void copy(void* dest, int start, int count);
|
void copy(void* dest, int start, int count);
|
||||||
|
|
||||||
|
// Fill an entire block with a byte value
|
||||||
|
void fill(uint8_t v);
|
||||||
|
|
||||||
// Lock the memory, forcing it to be loaded into a contiguous block of address space
|
// Lock the memory, forcing it to be loaded into a contiguous block of address space
|
||||||
void lock();
|
void lock();
|
||||||
|
|
||||||
|
|||||||
@@ -273,6 +273,18 @@ void Block::append(void* data, size_t size)
|
|||||||
unlock();
|
unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fill an entire block with a byte value
|
||||||
|
void Block::fill(uint8_t v)
|
||||||
|
{
|
||||||
|
if (getSize() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lock();
|
||||||
|
memset(getStart(), v, getSize());
|
||||||
|
unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Copy the entire data block to the destination pointer
|
// Copy the entire data block to the destination pointer
|
||||||
void Block::copy(void* dest)
|
void Block::copy(void* dest)
|
||||||
|
|||||||
Reference in New Issue
Block a user