5 ms·
How do they detect when the fallback should be used?
by rijoja 6y ago
How do they detect when the fallback should be used?
- bri3d 6y agoIt's right in the README - "Box86's Dynarec uses a mechanism with Memory Protection and a SegFault signal handler to handle JIT code." Essentially, code areas are write protected and when they trigger a write fault, the area is marked as "dirty" to be recompiled. https://github.com/ptitSeb/box86/commit/2aa2e53fef61d00df5354fcea68a7fd52b2712bd https://github.com/ptitSeb/box86/commit/2aa2e53fef61d00df535... first "protect memory, fault handler purges that code block as 'invalid' approach" and https://github.com/ptitSeb/box86/commit/4778760622df90c97da222cfdb3fba8d2cfe23dc https://github.com/ptitSeb/box86/commit/4778760622df90c97da2... second, "mark block as dirty rather than purging it" approach