instr_noalloc_t Struct Reference

#include <dr_ir_instr.h>

Data Fields

instr_t instr
opnd_t srcs [MAX_SRC_OPNDS - 1]
opnd_t dsts [MAX_DST_OPNDS]
byte encode_buf [MAX_INSTR_LENGTH]

Detailed Description

A version of instr_t which guarantees to not use heap allocation for regular decoding and encoding. It inlines all the possible operands and encoding space inside the structure. Some operations could still use heap if custom label data is used to point at heap-allocated structures through extension libraries or custom code.

The instr_from_noalloc() function should be used to obtain an instr_t pointer for passing to API functions:

instr_noalloc_init(dcontext, &noalloc);
pc = decode(dcontext, ptr, instr);

No freeing is required. To re-use the same structure, instr_reset() can be called.

Some operations are not supported on this instruction format:

This format does not support caching encodings, so it is less efficient for encoding. It is intended for use when decoding in a signal handler or other locations where heap allocation is unsafe.

Field Documentation

◆ dsts

opnd_t instr_noalloc_t::dsts[MAX_DST_OPNDS]

Built-in storage for destination operands.

◆ encode_buf

byte instr_noalloc_t::encode_buf[MAX_INSTR_LENGTH]

Encoding space for instr_length(), etc.

◆ instr

instr_t instr_noalloc_t::instr

The base instruction, valid for passing to API functions.

◆ srcs

opnd_t instr_noalloc_t::srcs[MAX_SRC_OPNDS - 1]

Built-in storage for source operands.

The documentation for this struct was generated from the following file:
  • /home/runner/work/dynamorio/dynamorio/build_release-64/include/dr_ir_instr.h
instr_t instr
Definition: dr_ir_instr.h:325
DR_API byte * decode(void *drcontext, byte *pc, instr_t *instr)
DR_API void instr_noalloc_init(void *drcontext, instr_noalloc_t *instr)
DR_API INSTR_INLINE instr_t * instr_from_noalloc(instr_noalloc_t *noalloc)
Definition: dr_defines.h:371
Definition: dr_ir_instr.h:324