context
context copied to clipboard
Try to emulate D language exception state save/restore on W64 context switch.
This hint about the D language fiber implementation points to this tactic for 32-bit Windows, and apparently to a simpler tactic for 64-bit Windows.
Specifically, it appears that for 64-bit Windows, the D fiber implementation saves and restores a three-pointer block at GS:[0] on every context switch. The root block is initialized to contain
-
0xFFFF'FFFF'FFFF'FFFF(next block in chain, sentinel value) - the high end of the stack and
- the low end of the stack
respectively.
This PR attempts to adopt the same tactic for the Windows 64 fcontext implementation of Boost.Context.
Sadly, with the Boost.Context built from this PR, these three programs that switch context during exception handling behave no differently than with unmodified Boost.Context.