From 435974a4994e06b5065ea77057de899dd53729bb Mon Sep 17 00:00:00 2001 From: Jb Evain Date: Fri, 2 Dec 2011 14:45:27 +0100 Subject: Reduce the number of resize required to read most method bodies --- Mono.Cecil.Cil/CodeReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Mono.Cecil.Cil/CodeReader.cs') diff --git a/Mono.Cecil.Cil/CodeReader.cs b/Mono.Cecil.Cil/CodeReader.cs index 61d04d9..4141617 100644 --- a/Mono.Cecil.Cil/CodeReader.cs +++ b/Mono.Cecil.Cil/CodeReader.cs @@ -145,7 +145,7 @@ namespace Mono.Cecil.Cil { code_size = 0; var end = start + code_size; - var instructions = body.instructions = new InstructionCollection (code_size / 3); + var instructions = body.instructions = new InstructionCollection ((code_size + 1) / 2); while (position < end) { var offset = base.position - start; -- cgit v1.2.3 From cf83e6fdbe0f6b676521ba641174a3085af60d0b Mon Sep 17 00:00:00 2001 From: Jb Evain Date: Wed, 22 Feb 2012 11:19:54 +0100 Subject: Expose ModuleDefinition.SymbolReader --- Mono.Cecil.Cil/CodeReader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Mono.Cecil.Cil/CodeReader.cs') diff --git a/Mono.Cecil.Cil/CodeReader.cs b/Mono.Cecil.Cil/CodeReader.cs index 4141617..12ca5a2 100644 --- a/Mono.Cecil.Cil/CodeReader.cs +++ b/Mono.Cecil.Cil/CodeReader.cs @@ -102,7 +102,7 @@ namespace Mono.Cecil.Cil { throw new InvalidOperationException (); } - var symbol_reader = reader.module.SymbolReader; + var symbol_reader = reader.module.symbol_reader; if (symbol_reader != null) { var instructions = body.Instructions; @@ -409,7 +409,7 @@ namespace Mono.Cecil.Cil { throw new NotSupportedException (); } - var symbol_reader = reader.module.SymbolReader; + var symbol_reader = reader.module.symbol_reader; if (symbol_reader != null && writer.metadata.write_symbols) { symbols.method_token = GetOriginalToken (writer.metadata, method); symbols.local_var_token = local_var_token; -- cgit v1.2.3 From b7b326bc04ea430728edc9668e6ae5e031fc8ac2 Mon Sep 17 00:00:00 2001 From: Jb Evain Date: Wed, 22 Apr 2015 20:06:32 +0200 Subject: Update copyrights --- Mono.Cecil.Cil/CodeReader.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Mono.Cecil.Cil/CodeReader.cs') diff --git a/Mono.Cecil.Cil/CodeReader.cs b/Mono.Cecil.Cil/CodeReader.cs index 12ca5a2..66f685f 100644 --- a/Mono.Cecil.Cil/CodeReader.cs +++ b/Mono.Cecil.Cil/CodeReader.cs @@ -4,7 +4,8 @@ // Author: // Jb Evain (jbevain@gmail.com) // -// Copyright (c) 2008 - 2011 Jb Evain +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the -- cgit v1.2.3 From 8b689ecdc890cbf3715ba8775de1d713d71f09f3 Mon Sep 17 00:00:00 2001 From: Jb Evain Date: Wed, 22 Apr 2015 21:18:11 +0200 Subject: Simplify header --- Mono.Cecil.Cil/CodeReader.cs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'Mono.Cecil.Cil/CodeReader.cs') diff --git a/Mono.Cecil.Cil/CodeReader.cs b/Mono.Cecil.Cil/CodeReader.cs index 66f685f..38bba66 100644 --- a/Mono.Cecil.Cil/CodeReader.cs +++ b/Mono.Cecil.Cil/CodeReader.cs @@ -1,30 +1,11 @@ // -// CodeReader.cs -// // Author: // Jb Evain (jbevain@gmail.com) // // Copyright (c) 2008 - 2015 Jb Evain // Copyright (c) 2008 - 2011 Novell, Inc. // -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Licensed under the MIT/X11 license. // using System; -- cgit v1.2.3