Re: [GHC] #5218: Add unpackCStringLen# to create Strings from string literals

#5218: Add unpackCStringLen# to create Strings from string literals -------------------------------------+------------------------------------- Reporter: tibbe | Owner: thoughtpolice Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.0.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #5877 #10064 | Differential Rev(s): Phab:D2443 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari):
I mean can we change ByteArray# 's representation into just length and content (removing the header)?
I don't believe this is possible; as you point out, the garbage collecting needs the info table pointer.
It seems to me we want a way to write a `ByteArray#` literal, without forcing every string literal to be compiled to a `ByteArray#`.
I agree; I can see the value in wanting a `ByteArray#` literal, but making all primitive strings `ByteArray#`s seems like a step too far. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/5218#comment:69 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC