internal virtual void Free() { if (lazyRegularInstructions != null) { lazyRegularInstructions.Free(); lazyRegularInstructions = null; } }
public MethodBody(Microsoft.Cci.MemoryStream ilBits, ushort maxStack, Microsoft.Cci.IMethodDefinition parent, IEnumerable <LocalDefinition> locals, Microsoft.Cci.SequencePoint[] sequencePoints) { this.ilBits = ilBits; this.maxStack = maxStack; this.parent = parent; this.locals = locals; this.sequencePoints = sequencePoints; }
public MethodBody(Microsoft.Cci.MemoryStream ilBits, ushort maxStack, Microsoft.Cci.IMethodDefinition parent, IEnumerable<LocalDefinition> locals, Microsoft.Cci.SequencePoint[] sequencePoints) { this.ilBits = ilBits; this.maxStack = maxStack; this.parent = parent; this.locals = locals; this.sequencePoints = sequencePoints; }
/// <summary> /// Produces a serialized blob of all constant initializers. /// Nonconstat initializers are matched with a zero of corresponding size. /// </summary> private byte[] GetRawData(ImmutableArray <BoundExpression> inits) { // the initial size is a guess. // there is no point to be precise here as MemoryStream always has N + 1 storage // and will need to be trimmed regardless var ms = new Microsoft.Cci.MemoryStream((uint)(inits.Length * 4)); var bw = new Microsoft.Cci.BinaryWriter(ms); SerializeArrayRecursive(bw, inits); byte[] data = ms.Buffer; // trim Array.Resize(ref data, (int)ms.Position); return(data); }
internal virtual void Free() { if (_lazyRegularInstructions != null) { _lazyRegularInstructions.Free(); _lazyRegularInstructions = null; } }
public MethodILBuilder(Emit.Module moduleBeingBuilt) { this.ilBits = new Microsoft.Cci.MemoryStream(); this.writer = new Microsoft.Cci.BinaryWriter(this.ilBits); this.moduleBeingBuilt = moduleBeingBuilt; }
public ILBuilder(Emit.Module moduleBeingBuilt) { this.ilBits = new Microsoft.Cci.MemoryStream(); this.writer = new Microsoft.Cci.BinaryWriter(this.ilBits); this.moduleBeingBuilt = moduleBeingBuilt; }
/// <summary> /// Produces a serialized blob of all constant initializers. /// Nonconstat initializers are matched with a zero of corresponding size. /// </summary> private byte[] GetRawData(ImmutableArray<BoundExpression> inits) { // the initial size is a guess. // there is no point to be precise here as MemoryStream always has N + 1 storage // and will need to be trimmed regardless var ms = new Microsoft.Cci.MemoryStream((uint)(inits.Length * 4)); var bw = new Microsoft.Cci.BinaryWriter(ms); SerializeArrayRecursive(bw, inits); byte[] data = ms.Buffer; // trim Array.Resize(ref data, (int)ms.Position); return data; }