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) { }