Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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(...)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant