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

Enable miscellaneous parts of the standard library on Windows #12281

Merged

Conversation

HertzDevil
Copy link
Contributor

  • Fatal failure to resume a fiber now prints the stack trace before exiting.
  • File.tempname now includes the running process's ID.
  • require "http" now pulls in the same files as it does on non-Windows systems.
  • Unused fiber stacks are now routinely cleaned up.

@HertzDevil HertzDevil added kind:feature topic:stdlib platform:windows Windows support based on the MSVC toolchain / Win32 API labels Jul 16, 2022
Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @HertzDevil 🙏

@straight-shoota straight-shoota added this to the 1.6.0 milestone Jul 17, 2022
@straight-shoota straight-shoota merged commit bd37b40 into crystal-lang:master Jul 19, 2022
@HertzDevil HertzDevil deleted the feature/windows-misc branch July 20, 2022 07:16
HertzDevil added a commit to HertzDevil/crystal that referenced this pull request Jul 20, 2022
Follow-up to crystal-lang#12281. This exception shows up when an unused fiber stack is collected:

```
Unhandled exception in spawn(name: Fiber Clean Loop): VirtualFree: The parameter is incorrect. (RuntimeError)
  from src\crystal\system\win32\fiber.cr:17 in 'free_stack'
  from src\fiber\stack_pool.cr:18 in 'collect'
  from src\fiber\stack_pool.cr:15 in 'collect'
  from src\kernel.cr:526 in '->'
  from src\fiber.cr:146 in 'run'
  from src\fiber.cr:98 in '->'
```

According to the documentation for [`VirtualFree`](https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualfree), the `dwSize` parameter must be 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature platform:windows Windows support based on the MSVC toolchain / Win32 API topic:stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants