Skip to Main Content
C# in a Nutshell
book

C# in a Nutshell

by Ben Albahari, Ted Neward, Peter Drayton
March 2002
Intermediate to advanced content levelIntermediate to advanced
864 pages
31h 8m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell

Name

MethodImplAttributes

Synopsis

These flags specify how a method has been implemented. Managed, Unmanaged, and ManagedMask indicate whether the method is managed or unmanaged code. If a method allows only one thread to execute it at a time, then its Synchronized flag is set. ForwardRef specifies that the method has not been defined, and InternalCall indicates that the method is an internal call. IL and OPTIL specify the code is IL or optimized IL. If the method is provided by the runtime, Runtime should be set, and if the method implementation is native, Native is marked. When a method should not be inlined during optimization, NoInlining is set. When the method signature should be exported exactly as specified, PreserveSig is set.

public enum MethodImplAttributes {
   Managed = 0,
   IL = 0,
   Native = 1,
   OPTIL = 2,
   Runtime = 3,
   CodeTypeMask = 3,
   Unmanaged = 4,
   ManagedMask = 4,
   NoInlining = 8,
   ForwardRef = 16,
   Synchronized = 32,
   PreserveSig = 128,
   InternalCall = 4096,
   MaxMethodImplVal = 65535
}

Hierarchy

System.ObjectSystem.ValueTypeSystem.Enum(System.IComparable, System.IFormattable, System.IConvertible)MethodImplAttributes

Returned By

MethodBase.GetMethodImplementationFlags()

Passed To

System.Reflection.Emit.ConstructorBuilder.SetImplementationFlags(), System.Reflection.Emit.MethodBuilder.SetImplementationFlags()

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# 8.0 in a Nutshell

C# 8.0 in a Nutshell

Joseph Albahari, Eric Johannsen
C# 10 in a Nutshell

C# 10 in a Nutshell

Joseph Albahari
C# in a Nutshell, Second Edition

C# in a Nutshell, Second Edition

Peter Drayton, Ben Albahari, Ted Neward
Code like a Pro in C#

Code like a Pro in C#

Jort Rodenburg

Publisher Resources

ISBN: 0596001819Catalog PageErrata