internal PdbLogger(bool logging) { _logging = logging; if (logging) { // do not get this from pool // we need a fairly large buffer here (where the pool typically contains small ones) // and we need just one per compile session // pooling will be couter-productive in such scenario _logData = new BlobBuilder(bufferFlushLimit); _incrementalHash = IncrementalHash.Create(AssemblyHashAlgorithm.Sha1); } else { _logData = null; _incrementalHash = null; } }
internal static void AppendData(this IncrementalHash hash, ArraySegment <byte> segment) { hash.AppendData(segment.Array, segment.Offset, segment.Count); }
internal static void AppendData(this IncrementalHash hash, ArraySegment <byte> segment) { RoslynDebug.AssertNotNull(segment.Array); hash.AppendData(segment.Array, segment.Offset, segment.Count); }