on master help sign in
Fix ghcjs build taking too much memory
commit2842d5089cba9634e9ca1a5bbccd2569894b9ec0 authorHarendra Kumar <harendra@composewell.com> dateSun 5 Sep 2021, 20:32 (5 years ago) parent57a2938
3 files changed+13−1
benchmark/streamly-benchmarks.cabal+3 src/Streamly/Internal/Unicode/Stream.hs+9 streamly.cabal+1−1
benchmark/streamly-benchmarks.cabal+3
@@ -510,6 +510,9 @@ benchmark Unicode.Char
510510 type: exitcode-stdio-1.0
511511 hs-source-dirs: Streamly/Benchmark/Unicode
512512 main-is: Char.hs
513+ -- Takes too much memory for ghcjs
514+ if impl(ghcjs)
515+ buildable: false
513516
514517benchmark Unicode.Utf8
515518 import: bench-options
src/Streamly/Internal/Unicode/Stream.hs+9
@@ -297,7 +297,10 @@ decode1 table state codep byte =
297297-- Resumable UTF-8 decoding
298298-------------------------------------------------------------------------------
299299
300+-- Strangely, GHCJS hangs linking template-haskell with this
301+#ifndef __GHCJS__
300302{-# ANN type UTF8DecodeState Fuse #-}
303+#endif
301304data UTF8DecodeState s a
302305 = UTF8DecodeInit s
303306 | UTF8DecodeInit1 s Word8
@@ -567,7 +570,9 @@ decodeUtf8Lax = decodeUtf8
567570-- Decoding Array Streams
568571-------------------------------------------------------------------------------
569572
573+#ifndef __GHCJS__
570574{-# ANN type FlattenState Fuse #-}
575+#endif
571576data FlattenState s a
572577 = OuterLoop s !(Maybe (DecodeState, CodePoint))
573578 | 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))))
777782 x3 = fromIntegral $ ((n `shiftR` 6) .&. 0x3F) + 0x80
778783 x4 = fromIntegral $ (n .&. 0x3F) + 0x80
779784
785+#ifndef __GHCJS__
780786{-# ANN type EncodeState Fuse #-}
787+#endif
781788data EncodeState s = EncodeState s !WList
782789
790+#ifndef __GHCJS__
783791{-# ANN type InvalidAction Fuse #-}
792+#endif
784793data InvalidAction =
785794 DropInvalid | ErrorInvalid | IgnoreInvalid | ReplaceInvalid
786795
streamly.cabal+1−1
@@ -238,7 +238,7 @@ common compile-options
238238 ghc-options: -fno-ignore-asserts
239239
240240 if flag(limit-build-mem)
241− ghc-options: +RTS -M512M -RTS
241+ ghc-options: +RTS -M1000M -RTS
242242
243243common default-extensions
244244 default-extensions: