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

Function discard

runtime/Perf.cc:79–84  ·  view source on GitHub ↗

* This function just discards its argument. It's used to make it * appear that data is used, so that the compiler won't optimize * away the code we're trying to measure. * * \param value * Pointer to arbitrary value; it's discarded. */

Source from the content-addressed store, hash-verified

77 * Pointer to arbitrary value; it's discarded.
78 */
79void discard(void* value) {
80 int x = *reinterpret_cast<int*>(value);
81 if (x == 0x43924776) {
82 printf("Value was 0x%x\n", x);
83 }
84}
85
86static uint64_t cntr = 0;
87

Callers 15

aggregate_customFunctionFunction · 0.70
aggregate_templatesFunction · 0.70
aggregate_va_argsFunction · 0.70
ifstreamReadHelperFunction · 0.70
freadHelperFunction · 0.70
fgetcFnFunction · 0.70
sched_getcpu_rdtscp_testFunction · 0.70
compressBinarySearchFunction · 0.70
compressLinearSearchFunction · 0.70
delayInBenchmarkFunction · 0.70
functionCallFunction · 0.70
functionDereferenceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected