Skip to content

Commit b0287dc

Browse files
Disservinvondele
authored andcommitted
apply const to prefetch parameter
closes #5296 No functional change
1 parent d0b9411 commit b0287dc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/misc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,14 @@ void start_logger(const std::string& fname) { Logger::start(fname); }
415415

416416
#ifdef NO_PREFETCH
417417

418-
void prefetch(void*) {}
418+
void prefetch(const void*) {}
419419

420420
#else
421421

422-
void prefetch(void* addr) {
422+
void prefetch(const void* addr) {
423423

424424
#if defined(_MSC_VER)
425-
_mm_prefetch((char*) addr, _MM_HINT_T0);
425+
_mm_prefetch((char const*) addr, _MM_HINT_T0);
426426
#else
427427
__builtin_prefetch(addr);
428428
#endif

src/misc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ std::string compiler_info();
4040
// Preloads the given address in L1/L2 cache. This is a non-blocking
4141
// function that doesn't stall the CPU waiting for data to be loaded from memory,
4242
// which can be quite slow.
43-
void prefetch(void* addr);
43+
void prefetch(const void* addr);
4444

4545
void start_logger(const std::string& fname);
4646
void* std_aligned_alloc(size_t alignment, size_t size);

0 commit comments

Comments
 (0)