MicrobenchmarksGui icon indicating copy to clipboard operation
MicrobenchmarksGui copied to clipboard

int 31-bit overflow

Open ip7z opened this issue 11 months ago • 0 comments

MemoryLatency.c

float RunLatencyTest(uint32_t size_kb, uint64_t iterations) {
    for (int i = 0; i < iterations; i++) {
        current = A[current];

here we have int 31-bit overflow for big iterations value. Also the code is not optimal, when we compare int with uint64_t in loop.

ip7z avatar Feb 14 '25 10:02 ip7z