Skip to content

Fix issues around Xcode 16, and rename to parse(...) from init(...)#133

Open
rinsuki wants to merge 1 commit intocezheng:masterfrom
rinsuki:rename-to-parse-from-init
Open

Fix issues around Xcode 16, and rename to parse(...) from init(...)#133
rinsuki wants to merge 1 commit intocezheng:masterfrom
rinsuki:rename-to-parse-from-init

Conversation

@rinsuki
Copy link

@rinsuki rinsuki commented Feb 2, 2025

We shouldn't depends to pointer is still valid after withUnsafe~'s callback is ended (and Xcode 16's swiftc finally breaks it).

but convenience init will not allow us to call self.init from withUnsafe~'s callback, so there are two options:

  • Allocate temporary memory, copy input to it, feed it to libxml2, then free it
  • Rename to parse(...) from init(...) and call libxml2 inside of withUnsafe~ callback
    • This is what this pull-request does
    • Pros: No additional copy/allocate in Fuzi part
    • Cons: breaking changes to our API

We shouldn't depends to pointer is still valid after withUnsafe~'s callback is end.

but `convenience init` will not allow us to call self.init inside of withUnsafe~'s callback, this is why we need to rename to parse(...) from init(...)
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