1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Adds some further `costs.

This commit is contained in:
Thomas Harte
2020-05-09 23:03:33 -04:00
parent 25996ce180
commit 05c3f2a30d
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -11,14 +11,14 @@
#include <cstdlib>
void Memory::Fuzz(uint8_t *buffer, std::size_t size) {
unsigned int divider = (unsigned(RAND_MAX) + 1) / 256;
const unsigned int divider = (unsigned(RAND_MAX) + 1) / 256;
unsigned int shift = 1, value = 1;
while(value < divider) {
value <<= 1;
shift++;
++shift;
}
for(std::size_t c = 0; c < size; c++) {
for(size_t c = 0; c < size; c++) {
buffer[c] = uint8_t(std::rand() >> shift);
}
}