[Git][ghc/ghc][wip/js-staging] Remove duplicated comment

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Wed Oct 19 10:07:40 UTC 2022



Sylvain Henry pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
0f518197 by Sylvain Henry at 2022-10-19T12:11:06+02:00
Remove duplicated comment

- - - - -


1 changed file:

- compiler/GHC/HsToCore/Foreign/Decl.hs


Changes:

=====================================
compiler/GHC/HsToCore/Foreign/Decl.hs
=====================================
@@ -173,41 +173,6 @@ dsFExport fn_id co ext_name cconv is_dyn = do
     ArchJavaScript -> dsJsFExport fn_id co ext_name cconv is_dyn
     _              -> dsCFExport  fn_id co ext_name cconv is_dyn
 
-{-
- at foreign import "wrapper"@ (previously "foreign export dynamic") lets
-you dress up Haskell IO actions of some fixed type behind an
-externally callable interface (i.e., as a C function pointer). Useful
-for callbacks and stuff.
-
-\begin{verbatim}
-type Fun = Bool -> Int -> IO Int
-foreign import "wrapper" f :: Fun -> IO (FunPtr Fun)
-
--- Haskell-visible constructor, which is generated from the above:
--- SUP: No check for NULL from createAdjustor anymore???
-
-f :: Fun -> IO (FunPtr Fun)
-f cback =
-   bindIO (newStablePtr cback)
-          (\StablePtr sp# -> IO (\s1# ->
-              case _ccall_ createAdjustor cconv sp# ``f_helper'' <arg info> s1# of
-                 (# s2#, a# #) -> (# s2#, A# a# #)))
-
-foreign import "&f_helper" f_helper :: FunPtr (StablePtr Fun -> Fun)
-
--- and the helper in C: (approximately; see `mkFExportCBits` below)
-
-f_helper(StablePtr s, HsBool b, HsInt i)
-{
-        Capability *cap;
-        cap = rts_lock();
-        rts_inCall(&cap,
-                   rts_apply(rts_apply(deRefStablePtr(s),
-                                       rts_mkBool(b)), rts_mkInt(i)));
-        rts_unlock(cap);
-}
-\end{verbatim}
--}
 
 foreignExportsInitialiser :: Platform -> Module -> [Id] -> CStub
 foreignExportsInitialiser _        _   []     = mempty



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0f5181977ade9de102021a3c9c41747d2773985c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0f5181977ade9de102021a3c9c41747d2773985c
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221019/3e7e8689/attachment-0001.html>


More information about the ghc-commits mailing list