Skip to content

Commit 3e4c7b1

Browse files
committed
EncodedBlocks should report real output size, not the allocated buffer
1 parent 710bcf0 commit 3e4c7b1

File tree

1 file changed

+4
-1
lines changed
  • DataFormats/Detectors/Common/include/DetectorsCommonDataFormats

1 file changed

+4
-1
lines changed

DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/EncodedBlocks.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@ class EncodedBlocks
468468
/// total allocated size in bytes
469469
size_t size() const { return mRegistry.size; }
470470

471+
/// used part of total allocated size in bytes (output size)
472+
size_t outputsize() const { return mRegistry.offsFreeStart; }
473+
471474
/// size remaining for additional data
472475
size_t getFreeSize() const { return mRegistry.getFreeSize(); }
473476

@@ -899,7 +902,7 @@ void EncodedBlocks<H, N, W>::print(const std::string& prefix, int verbosity) con
899902
ndata += mBlocks[i].getNData();
900903
nlit += mBlocks[i].getNLiterals();
901904
}
902-
LOG(info) << prefix << N << " blocks, input size: " << inpSize << ", output size: " << size()
905+
LOG(info) << prefix << N << " blocks, input size: " << inpSize << ", output size: " << outputsize()
903906
<< " NDictWords: " << ndict << " NDataWords: " << ndata << " NLiteralWords: " << nlit;
904907
}
905908
}

0 commit comments

Comments
 (0)