OpCodes.Localloc Campo
Definição
Aloca um determinado número de bytes do pool de memória dinâmica local e envia o endereço (um ponteiro transitório, tipo ) do primeiro byte alocado à pilha de avaliação.Allocates a certain number of bytes from the local dynamic memory pool and pushes the address (a transient pointer, type
) of the first allocated byte onto the evaluation stack.
public: static initonly System::Reflection::Emit::OpCode Localloc;
public static readonly System.Reflection.Emit.OpCode Localloc;
staticval mutable Localloc : System.Reflection.Emit.OpCode
Public Shared ReadOnly Localloc As OpCode
Valor do campo
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 |
---|---|---|
FE 0FFE 0F | localloclocalloc | Aloque espaço do heap local.Allocate space from the local heap. |
O comportamento de transição de pilha, em ordem sequencial, é:The stack transitional behavior, in sequential order, is:
O número de bytes a serem alocados é enviado por push para a pilha.The number of bytes to be allocated is pushed onto the stack.
O número de bytes é retirado da pilha; uma quantidade de memória correspondente ao tamanho é alocada a partir do heap local.The number of bytes is popped from the stack; an amount of memory corresponding to the size is allocated from the local heap.
Um ponteiro para o primeiro byte da memória alocada é enviado por push para a pilha.A pointer to the first byte of the allocated memory is pushed onto the stack.
A localloc
instrução aloca size
bytes (tipo natural unsigned int
) do pool de memória dinâmica local e retorna o endereço (um ponteiro transitório, tipo *
) do primeiro byte alocado.The localloc
instruction allocates size
(type natural unsigned int
) bytes from the local dynamic memory pool and returns the address (a transient pointer, type *
) of the first allocated byte. O bloco de memória retornado será inicializado como 0 somente se o sinalizador de inicialização no método for true
.The block of memory returned is initialized to 0 only if the initialize flag on the method is true
. Quando o método atual executa um Ret , o pool de memória local é disponibilizado para reutilização.When the current method executes a Ret, the local memory pool is made available for reuse.
O endereço resultante é alinhado para que qualquer tipo de dados primitivo possa ser armazenado usando as stind
instruções (como Stind_I4 ) e carregado usando as ldind
instruções (como Ldind_I4 ).The resulting address is aligned so that any primitive data type can be stored there using the stind
instructions (such as Stind_I4) and loaded using the ldind
instructions (such as Ldind_I4).
A localloc
instrução não pode ocorrer em filter
um catch
bloco,, finally
ou fault
.The localloc
instruction cannot occur within a filter
, catch
, finally
, or fault
block.
StackOverflowException será gerado se não houver memória suficiente para atender à solicitação.StackOverflowException is thrown if there is insufficient memory to service the request.
A sobrecarga do método a seguir Emit pode usar o localloc
opcode:The following Emit method overload can use the localloc
opcode: