Fix increment of a loop counter for the random mode of the memory test.

This commit is contained in:
Takaaki FUKAI
2016-12-16 01:52:10 +09:00
parent 7085367623
commit 67428d3cea

View File

@ -269,14 +269,14 @@ int memory_execute_request(sb_request_t *sb_req, int thread_id)
LOG_EVENT_START(msg, thread_id);
switch (mem_req->type) {
case SB_MEM_OP_WRITE:
for (i = 0; i < memory_block_size; i++)
for (i = 0; i < memory_block_size; i += sizeof(int))
{
idx = (int)(sb_rnd_double() * (memory_block_size / sizeof(int)));
buf[idx] = tmp;
}
break;
case SB_MEM_OP_READ:
for (i = 0; i < memory_block_size; i++)
for (i = 0; i < memory_block_size; i += sizeof(int))
{
idx = (int)(sb_rnd_double() * (memory_block_size / sizeof(int)));
tmp = buf[idx];