variorum icon indicating copy to clipboard operation
variorum copied to clipboard

clocks_features: prevent subsequent calls to perf_storage_temp()

Open rountree opened this issue 4 years ago • 0 comments

The first call to perf_storage_temp() will either allocate 2UL * nsockets or 2UL * nthreads memory (depending on whether or not the function parameter control_domains is SOCKET or CORE) and store the pointer in the static local struct perf_data d variable. Subsequent calls to the function, regardless of the value of control_domains, will simply return the pointer to the static struct. No memory reallocation will occur. While no one should ever do that, there is nothing in the function preventing that from happening, either.

Resolve by adding an error message that trips on second and subsequent calls.

rountree avatar Mar 26 '20 07:03 rountree