Skip to content
  • Ben Gamari's avatar
    ghc-prim: Don't allocate a thunk for each unpacked UTF-8 character · 85a295d5
    Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
    While debugging #14005 I noticed that unpackCStringUtf8# was allocating
    a thunk for each Unicode character that it unpacked. This seems hardly
    worthwhile given that the thunk's closure will be at least three words,
    whereas the Char itself will be only two and requires only a bit of bit
    twiddling to construct.
    
    Test Plan: Validate
    
    Reviewers: simonmar, austin
    
    Subscribers: dfeuer, rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3769
    85a295d5