> Make a FieldReference and use that instead of a FieldDefinition in > whatever place you're getting the error.
But then I won't be able to add it to the class Fields collection: how can I let the class type know of its existence then? Since FieldDefinition inherits from FieldReference, casting to FieldReference should work, shouldn't it? On 8 juil, 14:23, Alex <[email protected]> wrote: > Hi, > > >However, I have some PEVerify errors in assemblies that use Generics > > stating that fields inside generic classes should be referenced using > MemberRefs even on the same module than the class. How can I solve > that? > > Make a FieldReference and use that instead of a FieldDefinition in > whatever place you're getting the error. > > Regards, > Alex > > On Fri, Jul 8, 2011 at 1:45 PM, Indiefreaks.com > > > > <[email protected]> wrote: > > I believe it would be expensive too as far as I understand how IL is > > then transformed to native code: each method found within IL will be > > transformed in a native method call and if a program uses say, for > > instance, a simple for loop on hundreds of classes' methods, adding a > > "nested" method call would increase cpu usage. > > > On another hand, I managed to inject the code before every ret making > > sure that the stack stays correct when a value is returned. > > > However, I have some PEVerify errors in assemblies that use Generics > > stating that fields inside generic classes should be referenced using > > MemberRefs even on the same module than the class. How can I solve > > that? > > > Thanks > > > On 8 juil, 11:16, Gábor Kozár <[email protected]> wrote: > >> I mean that method calls are expensive operations, unless, of course, the > >> JIT decides to inline them. > > >> 2011/7/8 Jb Evain <[email protected]> > > >> > On Fri, Jul 8, 2011 at 11:08 AM, Gábor Kozár <[email protected]> > >> > wrote: > >> > > But wouldn't that hurt performance? I realize that the JIT can inline > >> > > methods when it feels like it, but I don't know under what > >> > > circumstances. > > >> > Not more than injecting code at every ret point. > > >> > Jb > > >> > -- > >> > -- > >> > mono-cecil- Masquer le texte des messages précédents - > > >> - Afficher le texte des messages précédents - > > > -- > > -- > > mono-cecil- Masquer le texte des messages précédents - > > - Afficher le texte des messages précédents - -- -- mono-cecil
