OpCodes.Sizeof Campo

Definição

Envia o tamanho, em bytes, de um tipo de valor fornecido para a pilha de avaliação.Pushes the size, in bytes, of a supplied value type onto the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Sizeof;
public static readonly System.Reflection.Emit.OpCode Sizeof;
 staticval mutable Sizeof : System.Reflection.Emit.OpCode
Public Shared ReadOnly Sizeof As OpCode 

Valor do campo

OpCode

Comentários

A tabela a seguir lista o formato de assembly hexadecimal e da MSIL (Microsoft Intermediate Language) da instrução, juntamente com um resumo de referência breve:The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

FormatarFormat Formato do assemblyAssembly Format DescriçãoDescription
< DE FE 1C T >FE 1C < T > sizeof valTypesizeof valType Envie por push o tamanho, em bytes, de um tipo de valor como um unsigned int32 .Push the size, in bytes, of a value type as an unsigned int32.

O comportamento de transição de pilha, em ordem sequencial, é:The stack transitional behavior, in sequential order, is:

  1. O tamanho (em bytes) do tipo de valor fornecido ( valType ) é enviado para a pilha.The size (in bytes) of the supplied value type (valType) is pushed onto the stack.

valType deve ser um token de metadados (a typeref ou typedef ) que especifica um tipo de valor, tipo de referência ou parâmetro de tipo genérico.valType must be a metadata token (a typeref or typedef) that specifies a value type, reference type, or generic type parameter.

Para um tipo de referência, o tamanho retornado é o tamanho de um valor de referência do tipo correspondente (4 bytes em sistemas de 32 bits), não o tamanho dos dados armazenados em objetos referenciados pelo valor de referência.For a reference type, the size returned is the size of a reference value of the corresponding type (4 bytes on 32-bit systems), not the size of the data stored in objects referred to by the reference value. Um parâmetro de tipo genérico pode ser usado somente no corpo do tipo ou método que o define.A generic type parameter can be used only in the body of the type or method that defines it. Quando esse tipo ou método é instanciado, o parâmetro de tipo genérico é substituído por um tipo de valor ou tipo de referência.When that type or method is instantiated, the generic type parameter is replaced by a value type or reference type.

A sobrecarga do método a seguir Emit pode usar o sizeof opcode:The following Emit method overload can use the sizeof opcode:

Aplica-se a

Confira também