Skip to content
Snippets Groups Projects
Commit eaa8093b authored by Cheng Shao's avatar Cheng Shao Committed by Marge Bot
Browse files

wasm: mark freeJSVal as INLINE

This patch marks `freeJSVal` as `INLINE` for the wasm backend. I
noticed that the `freeJSVal` invocations are not inlined when
inspecting STG/Cmm dumps of downstream libraries that use release
build of the wasm backend. The performance benefit of inlining here is
very modest, but so is the cost anyway; if you are using `freeJSVal`
at all then you care about every potential chance to improve
performance :)
parent 7b2d1e6d
No related branches found
No related tags found
No related merge requests found
......@@ -147,6 +147,7 @@ data JSVal
-- the same 'JSVal', subsequent invocations are no-ops. You are
-- strongly recommended to call 'freeJSVal' on short-lived
-- intermediate 'JSVal' values for timely release of resources!
{-# INLINE freeJSVal #-}
freeJSVal :: JSVal -> IO ()
freeJSVal v@(JSVal p) = do
js_callback_unregister v
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment