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

Function discard

runtime/PerfHelper.h:104–109  ·  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

102 * Pointer to arbitrary value; it's discarded.
103 */
104void discard(void* value) {
105 int x = *reinterpret_cast<int*>(value);
106 if (x == 0x43924776) {
107 printf("Value was 0x%x\n", x);
108 }
109}
110
111// Below are 3 functions that use various methods to sum integers.
112

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected