-
Notifications
You must be signed in to change notification settings - Fork 1.2k
closure: make it build on Windows x86_64 #1440
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
Conversation
CC: @parkera |
@swift-ci please test |
1 similar comment
@swift-ci please test |
Seems reasonable. I thought we were actually depending on the swift-corelibs-libdispatch version of this file now, though. |
closure/runtime.c
Outdated
@@ -142,7 +139,7 @@ GC support stub routines | |||
|
|||
|
|||
|
|||
static void *_Block_alloc_default(const unsigned long size, const bool initialCountIsOne, const bool isObject) { | |||
static void *_Block_alloc_default(uintptr_t size, const bool initialCountIsOne, const bool isObject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this still be size_t though? I can see using the ptr types for the CAS.
Hmm, actually, yeah, the |
Windows x86_64 is a LLP64 environment. `unsigned long` is not `size_t`. Adjust the parameter to be the correct size for the allocator. This is compatible with the previous implementation on LP64 environments. Prefer to use the `__sync_bool_compare_and_swap` over the MSVC intrinsic which is overly strong. While in the area, remove an unused compare and swap method.
Switched to |
@compnerd I have been wondering that myself recently as well. We did need this during bringup (dispatch was not yet ready), and I wonder if it is still useful and still working for other platforms that are in that stage. |
Like Windows 64 bit, apparently. :) |
@swift-ci please test |
1 similar comment
@swift-ci please test |
That failure is really weird, its not at all related to this change, and the crasher there doesn't even reference Foundation. |
@swift-ci please test |
1 similar comment
@swift-ci please test |
Yup, ok. |
Windows x86_64 is a LLP64 environment.
unsigned long
is notsize_t
.Adjust the parameter to be the correct size for the allocator. This is
compatible with the previous implementation on LP64 environments.
Prefer to use the
__sync_bool_compare_and_swap
over the MSVCintrinsic which is overly strong. While in the area, remove an unused
compare and swap method.