Skip to content

Wrap z_stream in an UnsafeMutablePointer #308

@Cyberbeni

Description

@Cyberbeni

zlib depends on the address of the z_stream struct being unchanged between calls, so storing it directly is error prone. And although it might currently be working as expected, it relies on undefined behavior, see: https://github.com/swiftlang/swift/blob/af3e7e765549c0397288e60983c96d81639287ed/stdlib/public/core/UnsafePointer.swift#L197-L205

had a similar issue here: adam-fowler/compress-nio#12

Originally posted by @Cyberbeni in #306

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions