diff options
author | Andrew Martin <andrew.thaddeus@gmail.com> | 2019-07-17 09:53:54 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-08 13:24:52 -0400 |
commit | a70db7bf0e1b7ad34e082040d4c380f94525dc30 (patch) | |
tree | cb0bd13b36a414dab2b4648de0cc96d34ae8af21 /docs | |
parent | 77f3ba23b9fdde95a73c689791122070332733dc (diff) | |
download | haskell-a70db7bf0e1b7ad34e082040d4c380f94525dc30.tar.gz |
[skip ci] link to foreign cmm call
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/ffi-chap.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/users_guide/ffi-chap.rst b/docs/users_guide/ffi-chap.rst index f0b9e3fd34..7681875f09 100644 --- a/docs/users_guide/ffi-chap.rst +++ b/docs/users_guide/ffi-chap.rst @@ -124,12 +124,12 @@ When passing any of the unlifted array types as an argument to a foreign C call, a foreign function sees a pointer that refers to the payload of the array, not to the ``StgArrBytes``/``StgMutArrPtrs``/``StgSmallMutArrPtrs`` heap object -containing it [1]_. By contrast, a foreign Cmm call, introduced by -``foreign import prim``, sees the heap object, not just the payload. -This means that, in some situations, the foreign C function might not -need any knowledge of the RTS closure types. The following example -sums the first three bytes in a -``MutableByteArray#`` [2]_ without using anything from ``Rts.h``:: +containing it [1]_. By contrast, a :ref:`foreign Cmm call <ffi-prim>`, +introduced by ``foreign import prim``, sees the heap object, not just +the payload. This means that, in some situations, the foreign C function +might not need any knowledge of the RTS closure types. The following example +sums the first three bytes in a ``MutableByteArray#`` [2]_ without using +anything from ``Rts.h``:: // C source uint8_t add_triplet(uint8_t* arr) { |