diff --git a/unison-runtime/src/Unison/Runtime/Stack.hs b/unison-runtime/src/Unison/Runtime/Stack.hs index 90a0d8fb5a..aa07a53bba 100644 --- a/unison-runtime/src/Unison/Runtime/Stack.hs +++ b/unison-runtime/src/Unison/Runtime/Stack.hs @@ -279,6 +279,11 @@ data GClosure comb deriving stock (Show, Functor, Foldable, Traversable) {- ORMOLU_ENABLE -} +-- Singleton black hole value to avoid allocation. +blackHole :: Closure +blackHole = Closure GBlackHole +{-# NOINLINE blackHole #-} + pattern PAp :: CombIx -> GCombInfo (RComb Val) -> Seg -> Closure pattern PAp cix comb seg = Closure (GPAp cix comb seg) @@ -295,7 +300,9 @@ pattern Captured k a seg = Closure (GCaptured k a seg) pattern Foreign x = Closure (GForeign x) -pattern BlackHole = Closure GBlackHole +pattern BlackHole <- Closure GBlackHole + where + BlackHole = blackHole pattern UnboxedTypeTag t <- Closure (GUnboxedTypeTag t) where