diff --git a/Makefile b/Makefile index 0cbc4ec..dbe39d8 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,8 @@ ifeq ($(DEBUG),yes) PROFILE := no dummy := $(shell $(RM) rosella $(OBJS) $(GCDA) $(GCNO)) else - CFLAGS += -O3 -DNDEBUG -march=nocona + CFLAGS += -march=native -O2 -fomit-frame-pointer -mssse3 -mfpmath=sse + CFLAGS += -DNDEBUG endif ifeq ($(PROFILE),yes) @@ -33,6 +34,10 @@ ifneq (,$(wildcard *.gcda mods/*.gcda)) dummy := $(shell $(RM) rosella $(OBJS)) endif +CPPFLAGS += $(EXTRA_CPPFLAGS) +CFLAGS += $(EXTRA_CFLAGS) +LDFLAGS += $(EXTRA_LDFLAGS) + all: rosella depend: $(DEPS) diff --git a/gc.c b/gc.c index ecadfd8..b45af75 100644 --- a/gc.c +++ b/gc.c @@ -837,8 +837,11 @@ static void _collect_garbage(size_t min_free) } while (gc_max_size < need_bytes); /* Reallocate the unused space. */ - free(gc_ranges[gc_other_range()]); - gc_ranges[gc_other_range()] = (char*)malloc(gc_max_size); + { + char *unused_range = gc_ranges[gc_other_range()]; + gc_ranges[gc_other_range()] = (char*)malloc(gc_max_size); + free(unused_range); + } /* See if reallocation succeeded. */ if (!gc_ranges[gc_other_range()])