core/x86/instr.c
/* Returns number of bytes of heap used by instr */
Returns number of bytes of heap used by instr
Returns number of bytes of heap used by instr
int
instr_mem_usage(instr_t *instr)
{
    int usage = 0;
    if ((instr->flags & INSTR_RAW_BITS_ALLOCATED) != 0) {
        usage += instr->length;
    }
#ifdef CUSTOM_EXIT_STUBS
    if ((instr->flags & INSTR_HAS_CUSTOM_STUB) != 0) {
        instrlist_t *il = (instrlist_t *) instr->dsts;
        instr_t *in;
        CLIENT_ASSERT(il != NULL, "instr_mem_usage: custom stubs inconsistent");
        for (in = instrlist_first(il); in != NULL; in = instr_get_next(in))
            usage += instr_mem_usage(in);
    }
#endif
    if (instr->dsts != NULL) {
        usage += instr->num_dsts*sizeof(opnd_t);
    }
    if (instr->srcs != NULL) {
        usage += (instr->num_srcs-1)*sizeof(opnd_t);
    }
    usage += sizeof(instr_t);
    return usage;
}
int instr_mem_usage ( instr_t * instr ) { int usage = 0 ; if ( ( instr -> flags & INSTR_RAW_BITS_ALLOCATED ) != 0 ) { usage += instr -> length ; } #ifdef CUSTOM_EXIT_STUBS if ( ( instr -> flags & INSTR_HAS_CUSTOM_STUB ) != 0 ) { instrlist_t * il = ( instrlist_t * ) instr -> dsts ; instr_t * in ; CLIENT_ASSERT ( il != NULL , " " ) ; for ( in = instrlist_first ( il ) ; in != NULL ; in = instr_get_next ( in ) ) usage += instr_mem_usage ( in ) ; } #endif if ( instr -> dsts != NULL ) { usage += instr -> num_dsts * sizeof ( opnd_t ) ; } if ( instr -> srcs != NULL ) { usage += ( instr -> num_srcs - 1 ) * sizeof ( opnd_t ) ; } usage += sizeof ( instr_t ) ; return usage ; }
Returns number of bytes of heap used by instr
Returns number of bytes of heap used by instr
/* HACK: dsts is used to store list */ /* remember one src is static, rest are dynamic */