pureikyubu icon indicating copy to clipboard operation
pureikyubu copied to clipboard

Implement XPool

Open ogamespec opened this issue 3 years ago • 0 comments

The VirtualProtect operation turned out to be very slow.

To avoid wasting time setting the "X" bit for memory with recompiled code every time after segment generation, you should do the following:

  • When starting the emulator, allocate memory in advance and make VirtualProtect for execution for the whole big chunk (I think 256 MByte will be enough, define macro in Config.h)
  • Divide this pool into pages of 0x1000 bytes
  • Give one page to each segment
  • If space in a page runs out during segment generation (segment size is close to 0x1000 bytes) - abort segment generation

Thus, you won't waste time on segment allocation and setting "X" bit in runtime.

ogamespec avatar May 27 '21 17:05 ogamespec