summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2020-12-29 00:51:32 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-22 02:06:17 -0500
commit8901285ef64ab4aa16aa34096a1e2be42d4be246 (patch)
tree947ff1a36fd59ce5c321454cd48c6d0b412d1ec9
parent8d6aaa49e011ec58f88b65a50a90f64bfd0a1f60 (diff)
downloadhaskell-8901285ef64ab4aa16aa34096a1e2be42d4be246.tar.gz
Add hook markCapabilityIOManager
To allow I/O managers to have GC roots in the Capability, within the CapIOManager structure. Not yet used in this patch.
-rw-r--r--rts/Capability.c2
-rw-r--r--rts/IOManager.c7
-rw-r--r--rts/IOManager.h8
3 files changed, 17 insertions, 0 deletions
diff --git a/rts/Capability.c b/rts/Capability.c
index 05332514e3..afe21fcb46 100644
--- a/rts/Capability.c
+++ b/rts/Capability.c
@@ -1322,6 +1322,8 @@ markCapability (evac_fn evac, void *user, Capability *cap,
}
#endif
+ markCapabilityIOManager(evac, user, cap->iomgr);
+
// Free STM structures for this Capability
stmPreGCHook(cap);
}
diff --git a/rts/IOManager.c b/rts/IOManager.c
index 6782c3984d..5a6347c537 100644
--- a/rts/IOManager.c
+++ b/rts/IOManager.c
@@ -150,6 +150,13 @@ void wakeupIOManager(void)
}
+void markCapabilityIOManager(evac_fn evac STG_UNUSED,
+ void *user STG_UNUSED,
+ CapIOManager *iomgr STG_UNUSED)
+{
+}
+
+
/* Declared in rts/IOInterface.h. Used only by the MIO threaded I/O manager on
* Unix platforms.
*/
diff --git a/rts/IOManager.h b/rts/IOManager.h
index ed7b4dcdcf..ceb38508ea 100644
--- a/rts/IOManager.h
+++ b/rts/IOManager.h
@@ -21,6 +21,9 @@
#include "BeginPrivate.h"
+#include "sm/GC.h" // for evac_fn
+
+
/* The per-capability data structures belonging to the I/O manager.
*
* It can be accessed as cap->iomgr.
@@ -97,6 +100,11 @@ void exitIOManager(bool wait_threads);
void wakeupIOManager(void);
+/* GC hook: mark any per-capability GC roots the I/O manager uses.
+ */
+void markCapabilityIOManager(evac_fn evac, void *user, CapIOManager *iomgr);
+
+
/* Pedantic warning cleanliness
*/
#if !defined(THREADED_RTS) && defined(mingw32_HOST_OS)