Skip to content

Is it safe to use 'unsafeDupablePerformIO' for decoding/encoding? #163

Open
@hasufell

Description

@hasufell

In GitLab by @maerwald on Jul 17, 2022, 04:47

It is said that unsafePerformIO is single-threaded, but unsafeDupablePerformIO can break bracket-like functions. Yet, bytestring uses it with unsafeWithForeignPtr.

Similar discussion here haskell/unix#157 (comment)

Use sites: https://gitlab.haskell.org/haskell/filepath/-/blob/c7d80e16e71bc1c85f4cd6158a96f2be6de64a1c/System/OsString/Common.hs#L113-124

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions