mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-24 14:09:56 +00:00
size down insn_map structructure by reducing the size of some fields. this alone makes lib binary size 2.6MB smaller
This commit is contained in:
parent
1bdb23a76d
commit
18103e4a22
2
utils.c
2
utils.c
@ -71,7 +71,7 @@ unsigned int insn_reverse_id(insn_map *insns, unsigned int max, unsigned int id)
|
||||
|
||||
// count number of positive members in a list.
|
||||
// NOTE: list must be guaranteed to end in 0
|
||||
unsigned int count_positive(unsigned int *list)
|
||||
unsigned int count_positive(unsigned char *list)
|
||||
{
|
||||
unsigned int c;
|
||||
|
||||
|
8
utils.h
8
utils.h
@ -18,9 +18,9 @@ typedef struct Pair {
|
||||
typedef struct insn_map {
|
||||
unsigned int id;
|
||||
unsigned int mapid;
|
||||
unsigned int regs_use[32]; // list of implicit registers used by this instruction
|
||||
unsigned int regs_mod[32]; // list of implicit registers modified by this instruction
|
||||
unsigned int groups[8]; // list of group this instruction belong to
|
||||
unsigned char regs_use[12]; // list of implicit registers used by this instruction
|
||||
unsigned char regs_mod[20]; // list of implicit registers modified by this instruction
|
||||
unsigned char groups[8]; // list of group this instruction belong to
|
||||
bool branch; // branch instruction?
|
||||
bool indirect_branch; // indirect branch instruction?
|
||||
} insn_map;
|
||||
@ -48,7 +48,7 @@ unsigned int insn_reverse_id(insn_map *insns, unsigned int max, unsigned int id)
|
||||
|
||||
// count number of positive members in a list.
|
||||
// NOTE: list must be guaranteed to end in 0
|
||||
unsigned int count_positive(unsigned int *list);
|
||||
unsigned int count_positive(unsigned char *list);
|
||||
|
||||
#define ARR_SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user