summaryrefslogtreecommitdiff
path: root/rts/sm/GCThread.h
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-04-03 12:14:43 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-04-03 12:14:43 +0000
commited45b268cba82ed698853b4a1c3d35e904ec020d (patch)
tree383063927d974d3f5de3ee23127c0b1de10a9031 /rts/sm/GCThread.h
parentc36ca010c5f7e019c9dd4d122be5c22905777e38 (diff)
downloadhaskell-ed45b268cba82ed698853b4a1c3d35e904ec020d.tar.gz
in the non-threaded RTS, use a static gc_thread structure
Diffstat (limited to 'rts/sm/GCThread.h')
-rw-r--r--rts/sm/GCThread.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/rts/sm/GCThread.h b/rts/sm/GCThread.h
index aacef82cbc..c563d95efd 100644
--- a/rts/sm/GCThread.h
+++ b/rts/sm/GCThread.h
@@ -75,7 +75,7 @@
typedef struct step_workspace_ {
step * step; // the step for this workspace
- struct gc_thread_ * gct; // the gc_thread that contains this workspace
+ struct gc_thread_ * my_gct; // the gc_thread that contains this workspace
// where objects to be scavenged go
bdescr * todo_bd;
@@ -189,8 +189,6 @@ typedef struct gc_thread_ {
extern nat n_gc_threads;
-extern gc_thread **gc_threads;
-
/* -----------------------------------------------------------------------------
The gct variable is thread-local and points to the current thread's
gc_thread structure. It is heavily accessed, so we try to put gct
@@ -203,8 +201,14 @@ extern gc_thread **gc_threads;
__thread version.
-------------------------------------------------------------------------- */
+extern gc_thread **gc_threads;
+
+#if defined(THREADED_RTS)
+
#define GLOBAL_REG_DECL(type,name,reg) register type name REG(reg);
+#define SET_GCT(to) gct = (to)
+
#if defined(sparc_HOST_ARCH)
// Don't use REG_base or R1 for gct on SPARC because they're getting clobbered
// by something else. Not sure what yet. -- BL 2009/01/03
@@ -235,5 +239,15 @@ extern __thread gc_thread* gct;
#endif
+#else // not the threaded RTS
+
+extern StgWord8 the_gc_thread[];
+
+#define gct ((gc_thread*)&the_gc_thread)
+#define SET_GCT(to) /*nothing*/
+#define DECLARE_GCT /*nothing*/
+
+#endif
+
#endif // GCTHREAD_H