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
Originally posted by @Cyberbeni in #306