Skip to content

Conversation

@compnerd
Copy link
Member

@compnerd compnerd commented Sep 1, 2023

UnsafeMutableBufferPointer.allocate does not guarantee usage of malloc (and in fact guarantees the opposite due to alignment assumptions). The memory allocated by that must be released by UnsafeMutableBufferPointer.deallocate only as that is guaranteed to correctly call the deallocation routine. Leak memory rather than corrupting memory.

`UnsafeMutableBufferPointer.allocate` does not guarantee usage of
`malloc` (and in fact guarantees the opposite due to alignment
assumptions).  The memory allocated by that must be released by
`UnsafeMutableBufferPointer.deallocate` only as that is guaranteed to
correctly call the deallocation routine.  Leak memory rather than
corrupting memory.
@compnerd
Copy link
Member Author

compnerd commented Sep 1, 2023

CC: @DougGregor @rintaro @bnbarham

Remove more cross-domain frees.
@compnerd compnerd mentioned this pull request Sep 1, 2023
9 tasks
@DougGregor
Copy link
Member

This should be subsumed by #68271

@DougGregor DougGregor closed this Sep 1, 2023
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