Store a `State# RealWorld` in the ByteString

Open
#684 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
haskell
Domain
performance

Research direction

Begin by tracing how the ByteString pointer is initialized and accessed, focusing on deferForeignPtrAvailability and uses of accursedUnutterablePerformIO. Determine how State# RealWorld would flow through those paths, then verify that the deferred-availability helper can be removed and the unsafe calls are replaced without changing pointer behavior.

Written by the indexing model from the issue text.

Description

This allows passing the state thread used to initialize the ByteString’s pointer to the functions that access that pointer. As a result, deferForeignPtrAvailability can be removed, and most or all uses of accursedUnutterablePerformIO can be replaced with a safer function that takes a State# RealWorld argument.

Dominant language
Haskell
Stars
302
Forks
146
Avg merge
7d 21h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/bytestring

All issues in haskell/bytestring

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.