summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Shao <terrorjack@type.dance>2023-05-13 02:59:25 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-16 00:14:42 -0400
commita8f0435fc5516ad978064eeabcc24776b6b86351 (patch)
treee8f6d8ed28fa7bbb20cf12cd9a3f590a0fbb843a
parentd986c98e471e21aee0129e1fe1a7ba3059069256 (diff)
downloadhaskell-a8f0435fc5516ad978064eeabcc24776b6b86351.tar.gz
rts: fix --disable-large-address-space
This patch moves ACQUIRE_ALLOC_BLOCK_SPIN_LOCK/RELEASE_ALLOC_BLOCK_SPIN_LOCK from Storage.h to HeapAlloc.h. When --disable-large-address-space is passed to configure, the code in HeapAlloc.h makes use of these two macros. Fixes #23385.
-rw-r--r--rts/sm/HeapAlloc.h8
-rw-r--r--rts/sm/Storage.h9
2 files changed, 8 insertions, 9 deletions
diff --git a/rts/sm/HeapAlloc.h b/rts/sm/HeapAlloc.h
index b9f7c468be..32210d1297 100644
--- a/rts/sm/HeapAlloc.h
+++ b/rts/sm/HeapAlloc.h
@@ -10,6 +10,14 @@
#include "BeginPrivate.h"
+#if defined(THREADED_RTS)
+// needed for HEAP_ALLOCED below
+extern SpinLock gc_alloc_block_sync;
+#endif
+
+#define ACQUIRE_ALLOC_BLOCK_SPIN_LOCK() ACQUIRE_SPIN_LOCK(&gc_alloc_block_sync)
+#define RELEASE_ALLOC_BLOCK_SPIN_LOCK() RELEASE_SPIN_LOCK(&gc_alloc_block_sync)
+
/* -----------------------------------------------------------------------------
The HEAP_ALLOCED() test.
diff --git a/rts/sm/Storage.h b/rts/sm/Storage.h
index c6046de2c0..9c86abfc2b 100644
--- a/rts/sm/Storage.h
+++ b/rts/sm/Storage.h
@@ -43,15 +43,6 @@ extern Mutex sm_mutex;
#define ASSERT_SM_LOCK()
#endif
-#if defined(THREADED_RTS)
-// needed for HEAP_ALLOCED below
-extern SpinLock gc_alloc_block_sync;
-#endif
-
-#define ACQUIRE_ALLOC_BLOCK_SPIN_LOCK() ACQUIRE_SPIN_LOCK(&gc_alloc_block_sync)
-#define RELEASE_ALLOC_BLOCK_SPIN_LOCK() RELEASE_SPIN_LOCK(&gc_alloc_block_sync)
-
-
/* -----------------------------------------------------------------------------
The write barrier for MVARs and TVARs
-------------------------------------------------------------------------- */