summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorAdam Sandberg Ericsson <adam@sandbergericsson.se>2022-06-18 10:01:22 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-07 23:24:34 -0400
commit42c917df5be8d75f79a283a8ed59fbaf099bc973 (patch)
tree9efeae5f39cd9c8ff49ec68ceb3b9f5f5a6ee2cf /libraries/base
parentfa59223b05e24d6e477e3ab0ab296e32b2b65a8b (diff)
downloadhaskell-42c917df5be8d75f79a283a8ed59fbaf099bc973.tar.gz
rts: allow NULL to be used as an invalid StgStablePtr
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/GHC/Stable.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/libraries/base/GHC/Stable.hs b/libraries/base/GHC/Stable.hs
index fd4534133c..4c8123e07c 100644
--- a/libraries/base/GHC/Stable.hs
+++ b/libraries/base/GHC/Stable.hs
@@ -44,6 +44,8 @@ garbage collection (ordinary references may be relocated during garbage
collection). Consequently, stable pointers can be passed to foreign code,
which can treat it as an opaque reference to a Haskell value.
+The @StablePtr@ 0 is reserved for representing NULL in foreign code.
+
A value of type @StablePtr a@ is a stable pointer to a Haskell
expression of type @a@.
-}