wingo pushed a commit to branch wip-whippet
in repository guile.

commit 883a761775071bf931f6f314f31d9c21db95c1dd
Author: Andy Wingo <wi...@igalia.com>
AuthorDate: Sun Mar 20 21:03:26 2022 +0100

    Stub out support for multiple mutator threads on semi, mark-sweep
    
    For semi probably we never implement support for multiple mutator
    threads.  We will do local freelists for mark-sweep though.
---
 Makefile     | 13 ++++++++-----
 mark-sweep.h |  9 +++++++++
 semi.h       |  9 +++++++++
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index ca644681c..6237ac936 100644
--- a/Makefile
+++ b/Makefile
@@ -2,23 +2,26 @@ TESTS=gcbench quads mt-gcbench # MT_GCBench MT_GCBench2
 COLLECTORS=bdw semi mark-sweep parallel-mark-sweep
 
 CC=gcc
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing
+CFLAGS=-Wall -O2 -g -fno-strict-aliasing -Wno-unused -DNDEBUG
+INCLUDES=-I.
+LDFLAGS=-lpthread
+COMPILE=$(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS)
 
 ALL_TESTS=$(foreach COLLECTOR,$(COLLECTORS),$(addprefix 
$(COLLECTOR)-,$(TESTS)))
 
 all: $(ALL_TESTS)
 
 bdw-%: bdw.h conservative-roots.h %-types.h %.c
-       $(CC) $(CFLAGS) -DNDEBUG -lpthread `pkg-config --libs --cflags bdw-gc` 
-I. -DGC_BDW -o $@ $*.c
+       $(COMPILE) `pkg-config --libs --cflags bdw-gc` -DGC_BDW -o $@ $*.c
 
 semi-%: semi.h precise-roots.h %-types.h heap-objects.h %.c
-       $(CC) $(CFLAGS) -I. -DNDEBUG -DGC_SEMI -o $@ $*.c
+       $(COMPILE) -DGC_SEMI -o $@ $*.c
 
 mark-sweep-%: mark-sweep.h precise-roots.h serial-marker.h assert.h debug.h 
%-types.h heap-objects.h %.c
-       $(CC) $(CFLAGS) -I. -Wno-unused -DNDEBUG -DGC_MARK_SWEEP -o $@ $*.c
+       $(COMPILE) -DGC_MARK_SWEEP -o $@ $*.c
 
 parallel-mark-sweep-%: mark-sweep.h precise-roots.h parallel-marker.h assert.h 
debug.h %-types.h heap-objects.h %.c
-       $(CC) $(CFLAGS) -I. -Wno-unused -DNDEBUG -DGC_PARALLEL_MARK_SWEEP 
-lpthread -o $@ $*.c
+       $(COMPILE) -DGC_PARALLEL_MARK_SWEEP -o $@ $*.c
 
 check: $(addprefix test-$(TARGET),$(TARGETS))
 
diff --git a/mark-sweep.h b/mark-sweep.h
index 46e90de1d..d82f4d0c2 100644
--- a/mark-sweep.h
+++ b/mark-sweep.h
@@ -476,6 +476,15 @@ static struct context* initialize_gc(size_t size) {
   return cx;
 }
 
+static struct context* initialize_gc_for_thread(uintptr_t *stack_base,
+                                                struct context *parent) {
+  fprintf(stderr,
+          "Multiple mutator threads not yet implemented.\n");
+  exit(1);
+}
+static void finish_gc_for_thread(struct context *cx) {
+}
+
 static inline void print_start_gc_stats(struct context *cx) {
 }
 
diff --git a/semi.h b/semi.h
index d2918d974..72f8d0e19 100644
--- a/semi.h
+++ b/semi.h
@@ -173,6 +173,15 @@ static struct context* initialize_gc(size_t size) {
   return cx;
 }
 
+static struct context* initialize_gc_for_thread(uintptr_t *stack_base,
+                                                struct context *parent) {
+  fprintf(stderr,
+          "Semispace copying collector not appropriate for multithreaded 
use.\n");
+  exit(1);
+}
+static void finish_gc_for_thread(struct context *cx) {
+}
+
 static inline void print_start_gc_stats(struct context *cx) {
 }
 

Reply via email to