MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / flushCache

Function flushCache

runtime/PerfHelper.cc:28–36  ·  view source on GitHub ↗

Flush the CPU data cache by reading and writing 100MB of new data.

Source from the content-addressed store, hash-verified

26
27/// Flush the CPU data cache by reading and writing 100MB of new data.
28void
29flushCache()
30{
31 int hundredMegs = 100 * 1024 * 1024;
32 volatile char* block = new char[hundredMegs];
33 for (int i = 0; i < hundredMegs; i++)
34 block[i] = 1;
35 delete[] block;
36}
37
38/// Used in functionCall().
39uint64_t

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected