arm: use CreateImm0() & CreateReg0() to create MCOperand* to avoid using malloc/free to improve performance
diff --git a/MCInst.c b/MCInst.c
index e5c5e4f..d6f513a 100644
--- a/MCInst.c
+++ b/MCInst.c
@@ -42,6 +42,7 @@
cs_mem_free(Op);
}
+// do not free @Op
void MCInst_insert0(MCInst *inst, int index, MCOperand *Op)
{
int i;
@@ -173,8 +174,7 @@
return op;
}
-/*
-MCOperand *MCOperand_CreateReg0(MCInst *mcInst, unsigned Reg)
+MCOperand *MCOperand_CreateReg1(MCInst *mcInst, unsigned Reg)
{
MCOperand *op = &(mcInst->Operands[MCINST_CACHE]);
@@ -183,7 +183,6 @@
return op;
}
-*/
void MCOperand_CreateReg0(MCInst *mcInst, unsigned Reg)
{
@@ -204,8 +203,7 @@
return op;
}
-/*
-MCOperand *MCOperand_CreateImm0(MCInst *mcInst, int64_t Val)
+MCOperand *MCOperand_CreateImm1(MCInst *mcInst, int64_t Val)
{
MCOperand *op = &(mcInst->Operands[MCINST_CACHE]);
@@ -214,7 +212,6 @@
return op;
}
-*/
void MCOperand_CreateImm0(MCInst *mcInst, int64_t Val)
{