The "20,000 lines of source code" turns out to be a 104 megabyte zipped download, 395 files. Looks like most of the work is actually done in zillions of dll's.
An actual source file looks like...
//----------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All Rights Reserved. // //----------------------------------------------------------------------------- using System; using System.IO; using System.Globalization; using System.Runtime.InteropServices; using System.Text; //^ using Microsoft.Contracts;
// Left over work items: // 1) Try to optimize String reading and writing methods
#if !BIGENDIAN && !LITTLEENDIAN #error Either BIGENDIAN or LITTLEENDIAN must be defined. #endif
namespace Microsoft.Cci.UtilityDataStructures { unsafe struct MemoryBlock { internal readonly byte* Buffer; internal readonly int Length; internal MemoryBlock( byte* buffer, int length ) { this.Buffer = buffer; this.Length = length; } internal MemoryBlock( byte* buffer, uint length ) { this.Buffer = buffer; this.Length = (int)length; } }
unsafe internal struct MemoryReader { #region Fields //^ [SpecPublic] readonly byte* Buffer; //^ [SpecPublic] private byte* CurrentPointer; internal readonly int Length; // ^ invariant this.CurrentPointer >= this.Buffer; // ^ invariant this.CurrentPointer 0; // ^ invariant this.Buffer != null; // ^ invariant this.CurrentPointer != null; #endregion
#region Constructors internal MemoryReader( byte* buffer, int length, int offset ) //^ requires buffer != null; //^ requires offset 0; { this.Buffer = buffer; this.CurrentPointer = buffer + offset; this.Length = length; }
and so on. Garbage.
John