From ff18e6fd87a9869c437f98b05f4fa3e29896a51f Mon Sep 17 00:00:00 2001
From: Ben Gamari <ben@smart-cactus.org>
Date: Thu, 26 Jan 2023 17:19:59 -0500
Subject: [PATCH] nonmoving: Fix unused definition warrnings

---
 rts/sm/NonMovingMark.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index b0931f576732..c493cd4dd96c 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -39,7 +39,9 @@ static void trace_PAP_payload (MarkQueue *queue,
                                StgClosure *fun,
                                StgClosure **payload,
                                StgWord size);
+#if defined(DEBUG)
 static bool is_nonmoving_weak(StgWeak *weak);
+#endif
 
 // How many Array# entries to add to the mark queue at once?
 #define MARK_ARRAY_CHUNK_LENGTH 128
@@ -974,7 +976,7 @@ static void nonmovingResetUpdRemSetQueue (MarkQueue *rset)
     rset->top->head = 0;
 }
 
-void nonmovingResetUpdRemSet (UpdRemSet *rset)
+static void nonmovingResetUpdRemSet (UpdRemSet *rset)
 {
     nonmovingResetUpdRemSetQueue(&rset->queue);
 }
@@ -1973,6 +1975,7 @@ void nonmovingMarkWeakPtrList (struct MarkQueue_ *queue)
 
 // Determine whether a weak pointer object is on one of the nonmoving
 // collector's weak pointer lists. Used for sanity checking.
+#if defined(DEBUG)
 static bool is_nonmoving_weak(StgWeak *weak)
 {
     for (StgWeak *w = nonmoving_old_weak_ptr_list; w != NULL; w = w->link) {
@@ -1983,6 +1986,7 @@ static bool is_nonmoving_weak(StgWeak *weak)
     }
     return false;
 }
+#endif
 
 // Non-moving heap variant of `tidyWeakList`
 bool nonmovingTidyWeaks (struct MarkQueue_ *queue)
-- 
GitLab