summaryrefslogtreecommitdiff
path: root/includes/rts/StableName.h
diff options
context:
space:
mode:
authorDavid Feuer <david.feuer@gmail.com>2018-08-29 16:34:21 -0400
committerDavid Feuer <David.Feuer@gmail.com>2018-08-29 16:34:22 -0400
commitf48e276a5ba68d8b6fcb4a558022581fb30f9326 (patch)
tree8ea324b84d137d59cda566d6a559016d2c7437ea /includes/rts/StableName.h
parent65eec9cfd4410c0e30b0ed06116c15f8ce3de49d (diff)
downloadhaskell-f48e276a5ba68d8b6fcb4a558022581fb30f9326.tar.gz
Finish stable split
Long ago, the stable name table and stable pointer tables were one. Now, they are separate, and have significantly different implementations. I believe the time has come to finish the split that began in #7674. * Divide `rts/Stable` into `rts/StableName` and `rts/StablePtr`. * Give each table its own mutex. * Add FFI functions `hs_lock_stable_ptr_table` and `hs_unlock_stable_ptr_table` and document them. These are intended to replace the previously undocumented `hs_lock_stable_tables` and `hs_lock_stable_tables`, which are now documented as deprecated synonyms. * Make `eqStableName#` use pointer equality instead of unnecessarily comparing stable name table indices. Reviewers: simonmar, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15555 Differential Revision: https://phabricator.haskell.org/D5084
Diffstat (limited to 'includes/rts/StableName.h')
-rw-r--r--includes/rts/StableName.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/includes/rts/StableName.h b/includes/rts/StableName.h
new file mode 100644
index 0000000000..d43ffcb2f6
--- /dev/null
+++ b/includes/rts/StableName.h
@@ -0,0 +1,32 @@
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team, 1998-2009
+ *
+ * Stable Names
+ *
+ * Do not #include this file directly: #include "Rts.h" instead.
+ *
+ * To understand the structure of the RTS headers, see the wiki:
+ * http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
+ *
+ * ---------------------------------------------------------------------------*/
+
+#pragma once
+
+/* -----------------------------------------------------------------------------
+ PRIVATE from here.
+ -------------------------------------------------------------------------- */
+
+typedef struct {
+ StgPtr addr; // Haskell object when entry is in use, next free
+ // entry (NULL when this is the last free entry)
+ // otherwise. May be NULL temporarily during GC (when
+ // pointee dies).
+
+ StgPtr old; // Old Haskell object, used during GC
+
+ StgClosure *sn_obj; // The StableName object, or NULL when the entry is
+ // free
+} snEntry;
+
+extern DLL_IMPORT_RTS snEntry *stable_name_table;