Skip to content

Commit

Permalink
Inline argsToLists
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Dec 10, 2024
1 parent dfac404 commit 5e2b968
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion unison-runtime/src/Unison/Runtime/Foreign/Impl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ import UnliftIO qualified
foreignCall :: ForeignFunc -> Args -> XStack -> IOXStack
foreignCall !ff !args !xstk =
stackIOToIOX $ foreignCallHelper ff args (packXStack xstk)
{-# INLINE foreignCall #-}
{-# NOINLINE foreignCall #-}

foreignCallHelper :: ForeignFunc -> Args -> Stack -> IO Stack
foreignCallHelper = \case
Expand Down
2 changes: 2 additions & 0 deletions unison-runtime/src/Unison/Runtime/MCode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ argsToLists = \case
VArgR i l -> take l [i ..]
VArgN us -> primArrayToList us
VArgV _ -> internalBug "argsToLists: DArgV"
{-# INLINEABLE argsToLists #-}

countArgs :: Args -> Int
countArgs ZArgs = 0
Expand All @@ -293,6 +294,7 @@ countArgs (VArg2 {}) = 2
countArgs (VArgR _ l) = l
countArgs (VArgN us) = sizeofPrimArray us
countArgs (VArgV {}) = internalBug "countArgs: DArgV"
{-# INLINEABLE countArgs #-}

data UPrim1
= -- integral
Expand Down

0 comments on commit 5e2b968

Please sign in to comment.