Skip to content

Commit 79cc38e

Browse files
committed
Changing formatter to not use std::
1 parent 902ddc6 commit 79cc38e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizer.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ void* GPUTPCNNClusterizer::setIOPointers(void* mem)
6868

6969
if (mNnClusterizerVerbosity > 2) {
7070
if (mNnClusterizerVerbosity > 3) {
71-
auto fmt = [](size_t bytes) {
72-
std::ostringstream os;
73-
double mb = bytes / (1024.0 * 1024.0);
74-
os << bytes << " bytes (" << std::fixed << std::setprecision(3) << mb << " MB)";
75-
return os.str();
71+
auto fmt = [](size_t bytes) -> const char* {
72+
static char buf[64];
73+
double mb = (double)bytes / (1024.0 * 1024.0);
74+
int n = snprintf(buf, sizeof(buf), "%zu bytes (%.3f MB)", bytes, mb);
75+
(void)n;
76+
return buf;
7677
};
7778

7879
// Element counts (number of array entries, not bytes)

0 commit comments

Comments
 (0)