summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2014-02-27 14:07:29 +0000
committerSimon Marlow <marlowsd@gmail.com>2014-02-27 14:07:34 +0000
commitaf6746fb6b5adb5ba5be6e0f647c4ebe767ce084 (patch)
treefce2e5cf3989597d3a1446f68c18d82bb9d1403f /includes
parent68c0d8689dd93cb0ce74a288e82f2ed997c31acc (diff)
downloadhaskell-af6746fb6b5adb5ba5be6e0f647c4ebe767ce084.tar.gz
Add hs_thread_done() (#8124)
See documentation for details.
Diffstat (limited to 'includes')
-rw-r--r--includes/HsFFI.h1
-rw-r--r--includes/RtsAPI.h13
2 files changed, 14 insertions, 0 deletions
diff --git a/includes/HsFFI.h b/includes/HsFFI.h
index a21811efb5..ab3b3ebb23 100644
--- a/includes/HsFFI.h
+++ b/includes/HsFFI.h
@@ -150,6 +150,7 @@ extern void hs_init (int *argc, char **argv[]);
extern void hs_exit (void);
extern void hs_set_argv (int argc, char *argv[]);
extern void hs_add_root (void (*init_root)(void));
+extern void hs_thread_done (void);
extern void hs_perform_gc (void);
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h
index daae30b821..6e4decb8bd 100644
--- a/includes/RtsAPI.h
+++ b/includes/RtsAPI.h
@@ -223,6 +223,19 @@ void rts_checkSchedStatus (char* site, Capability *);
SchedulerStatus rts_getSchedStatus (Capability *cap);
+/*
+ * The RTS allocates some thread-local data when you make a call into
+ * Haskell using one of the rts_eval() functions. This data is not
+ * normally freed until hs_exit(). If you want to free it earlier
+ * than this, perhaps because the thread is about to exit, then call
+ * rts_done() from the thread.
+ *
+ * It is safe to make more rts_eval() calls after calling rts_done(),
+ * but the next one will cause allocation of the thread-local memory
+ * again.
+ */
+void rts_done (void);
+
/* --------------------------------------------------------------------------
Wrapper closures