Skip to content

io: free Windows operation data with _aligned_free() #493

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

Merged
merged 1 commit into from
Jun 11, 2019
Merged

io: free Windows operation data with _aligned_free() #493

merged 1 commit into from
Jun 11, 2019

Conversation

adierking
Copy link
Contributor

_dispatch_operation_perform() uses _aligned_malloc() on Windows to
allocate the data buffer. This means that we cannot use
DISPATCH_DATA_DESTRUCTOR_FREE when we create the dispatch_data_t.
Provide a custom destructor which correctly frees the buffer.

Discovered while porting the dispatch_io test to Windows.

`_dispatch_operation_perform()` uses `_aligned_malloc()` on Windows to
allocate the data buffer. This means that we cannot use
`DISPATCH_DATA_DESTRUCTOR_FREE` when we create the `dispatch_data_t`.
Provide a custom destructor which correctly frees the buffer.

Discovered while porting the dispatch_io test to Windows.
@adierking
Copy link
Contributor Author

cc @compnerd @ktopley-apple

@ktopley-apple
Copy link
Contributor

@swift-ci please test

@ktopley-apple ktopley-apple merged commit c5af10f into swiftlang:master Jun 11, 2019
rokhinip pushed a commit that referenced this pull request Nov 5, 2021
io: free Windows operation data with _aligned_free()
Signed-off-by: Kim Topley <[email protected]>
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.

2 participants