MahdiSafsafi / UnivDisasm

x86 Disassembler and Analyzer
Mozilla Public License 2.0
97 stars 36 forks source link

Optimize memory layout of TInstruction record #4

Open JBontes opened 9 years ago

JBontes commented 9 years ago

In X64 pointers are 8-bytes, so the current layout of TInstruction wastes a lot of space. It'd be better to rearrange the record to waste less memory.

I'll submit a pull request as soon as I'm able to test the changes.

MahdiSafsafi commented 9 years ago

Hi JBontes,

In x64 pointers are 8 bytes length. You can't just make them short or less than 8 bytes. If you do you will get a wrong results(Wrong JMP address,Wrong instruction size,...).

The only way to reduce memory usage is to work around fields that aren't pointer type.

Regards, Mahdi.