PCSX2 Documentation/PCSX2 EE Recompiler: Difference between revisions

Line 65: Line 65:


=== Lazy Allocation ===
=== Lazy Allocation ===
TODO
Recompiler buffers are lazy-allocated to reduce the physical memory footprint. During the init, contiguous virtual memories are reserved to hold the various buffers. However memories can't be accessed (no read, no write permission). A write to the buffer will trigger a segmentation fault that it will be caught by a dedicated handler. The handler will enable permission access. And therefore the memory will be allocated. In order to limit segmentation fault management, buffers are allocated by big block (typically 1/4th of the max size).
 
In my humble opinion, this mechanism is useless nowadays because
* kernel might already do lazy-allocation under the hood
* unused memory will be pushed in the swap
* 32 bits program on recent machines are limited by the virtual address space not the physical resources anymore. The former is 2-4GB whereas a single DDR4 module is 4GB.
 
Potentially this feature could be removed in the future.


=== Memory Protection ===
=== Memory Protection ===
ninja
56

edits