Skip to content

memchr#

It would be neat if we had a primitive for calling memchr on a ByteArray#. Something like this:

memchr :: ByteArray# -> Word# -> Int# -> Int# -> Int# 

The integer arguments are a starting index and length. I have a hunch that copyByteArray# and friends are just wrappers for memcpy that somehow prohibit the array from being moved by the GC while they are running. I would be happy to try to implement memchr# if it seems like an alright idea.

Trac metadata
Trac field Value
Version 8.2.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information