Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to emulate D language exception state save/restore on W64 context switch. #279

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

nat-goodspeed
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant