on master help sign in
Fix ghcjs build taking too much memory
2842d50Harendra Kumar
benchmark/streamly-benchmarks.cabal+3
@@ -510,6 +510,9 @@ benchmark Unicode.Char
510 type: exitcode-stdio-1.0
510 type: exitcode-stdio-1.0
511 hs-source-dirs: Streamly/Benchmark/Unicode
511 hs-source-dirs: Streamly/Benchmark/Unicode
512 main-is: Char.hs
512 main-is: Char.hs
513+ -- Takes too much memory for ghcjs
514+ if impl(ghcjs)
515+ buildable: false
513
516
514benchmark Unicode.Utf8
517benchmark Unicode.Utf8
515 import: bench-options
518 import: bench-options
src/Streamly/Internal/Unicode/Stream.hs+9
@@ -297,7 +297,10 @@ decode1 table state codep byte =
297-- Resumable UTF-8 decoding
297-- Resumable UTF-8 decoding
298-------------------------------------------------------------------------------
298-------------------------------------------------------------------------------
299
299
300+-- Strangely, GHCJS hangs linking template-haskell with this
301+#ifndef __GHCJS__
300{-# ANN type UTF8DecodeState Fuse #-}
302{-# ANN type UTF8DecodeState Fuse #-}
303+#endif
301data UTF8DecodeState s a
304data UTF8DecodeState s a
302 = UTF8DecodeInit s
305 = UTF8DecodeInit s
303 | UTF8DecodeInit1 s Word8
306 | UTF8DecodeInit1 s Word8
@@ -567,7 +570,9 @@ decodeUtf8Lax = decodeUtf8
567-- Decoding Array Streams
570-- Decoding Array Streams
568-------------------------------------------------------------------------------
571-------------------------------------------------------------------------------
569
572
573+#ifndef __GHCJS__
570{-# ANN type FlattenState Fuse #-}
574{-# ANN type FlattenState Fuse #-}
575+#endif
571data FlattenState s a
576data FlattenState s a
572 = OuterLoop s !(Maybe (DecodeState, CodePoint))
577 = OuterLoop s !(Maybe (DecodeState, CodePoint))
573 | InnerLoopDecodeInit s (ForeignPtr a) !(Ptr a) !(Ptr a)
578 | InnerLoopDecodeInit s (ForeignPtr a) !(Ptr a) !(Ptr a)
@@ -777,10 +782,14 @@ ord4 c = assert (n >= 0x10000) (WCons x1 (WCons x2 (WCons x3 (WCons x4 WNil))))
777 x3 = fromIntegral $ ((n `shiftR` 6) .&. 0x3F) + 0x80
782 x3 = fromIntegral $ ((n `shiftR` 6) .&. 0x3F) + 0x80
778 x4 = fromIntegral $ (n .&. 0x3F) + 0x80
783 x4 = fromIntegral $ (n .&. 0x3F) + 0x80
779
784
785+#ifndef __GHCJS__
780{-# ANN type EncodeState Fuse #-}
786{-# ANN type EncodeState Fuse #-}
787+#endif
781data EncodeState s = EncodeState s !WList
788data EncodeState s = EncodeState s !WList
782
789
790+#ifndef __GHCJS__
783{-# ANN type InvalidAction Fuse #-}
791{-# ANN type InvalidAction Fuse #-}
792+#endif
784data InvalidAction =
793data InvalidAction =
785 DropInvalid | ErrorInvalid | IgnoreInvalid | ReplaceInvalid
794 DropInvalid | ErrorInvalid | IgnoreInvalid | ReplaceInvalid
786
795
streamly.cabal+1−1
@@ -238,7 +238,7 @@ common compile-options
238 ghc-options: -fno-ignore-asserts
238 ghc-options: -fno-ignore-asserts
239
239
240 if flag(limit-build-mem)
240 if flag(limit-build-mem)
241− ghc-options: +RTS -M512M -RTS
241+ ghc-options: +RTS -M1000M -RTS
242
242
243common default-extensions
243common default-extensions
244 default-extensions:
244 default-extensions: