Re: [GHC] #5188: Runtime error when allocating lots of memory

#5188: Runtime error when allocating lots of memory ---------------------------------+--------------------------- Reporter: knyblad | Owner: Type: bug | Status: patch Priority: low | Milestone: 7.6.2 Component: GHCi | Version: 6.12.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86 Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------+--------------------------- Comment (by rwbarton): Casting to an unsigned integral type is defined to have "modulo 2^n^" semantics by C99 ยง6.3.1.3, so casting -1 to any unsigned integral type will result in the largest representable value of that type. But `HS_WORD_MAX` is okay too, and probably easier to read; I just didn't think to look for such a thing in `HsFFI.h`. (I find the proliferation of identical types `StgWord`, `W_`, `HsWord` a little confusing, but I'll get over it.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/5188#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC