Skip to content

Conversation

@spevans
Copy link
Contributor

@spevans spevans commented Feb 2, 2020

  • When taking an UnsafePointer to an array etc, the array could be
    deallocated whilst the pointer is still in use. This is fixed by
    either:

    1. Eliminating the pointer entirely and just passing the array or
      &array to the function.

    2. Creating and using the pointer inside a .withUnsafeBytes {}
      or .withUnsafeMutableBytes {} closure.

@spevans
Copy link
Contributor Author

spevans commented Feb 2, 2020

@swift-ci test

- When taking an UnsafePointer to an array etc, the array could be
  deallocated whilst the pointer is still in use. This is fixed by
  either:

  1. Eliminating the pointer entirely and just passing the array or
     &array to the function.

  2. Creating and using the pointer inside a .withUnsafeBytes {}
     or .withUnsafeMutableBytes {} closure.
@spevans spevans force-pushed the pr_dangling_pointer branch from f490508 to 4cf2543 Compare February 2, 2020 15:54
@spevans
Copy link
Contributor Author

spevans commented Feb 2, 2020

@swift-ci test

1 similar comment
@spevans
Copy link
Contributor Author

spevans commented Feb 2, 2020

@swift-ci test

@spevans
Copy link
Contributor Author

spevans commented Feb 3, 2020

@swift-ci test and merge

1 similar comment
@spevans
Copy link
Contributor Author

spevans commented Feb 3, 2020

@swift-ci test and merge

@swift-ci swift-ci merged commit 4a3fe0d into swiftlang:master Feb 3, 2020
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