Minor performance-related changes.

This commit is contained in:
Jesse D. McDonald 2009-12-09 22:27:44 -06:00
parent 8ca34f40ec
commit e8d1a2fa40
2 changed files with 11 additions and 3 deletions

View File

@ -20,7 +20,8 @@ ifeq ($(DEBUG),yes)
PROFILE := no PROFILE := no
dummy := $(shell $(RM) rosella $(OBJS) $(GCDA) $(GCNO)) dummy := $(shell $(RM) rosella $(OBJS) $(GCDA) $(GCNO))
else else
CFLAGS += -O3 -DNDEBUG -march=nocona CFLAGS += -march=native -O2 -fomit-frame-pointer -mssse3 -mfpmath=sse
CFLAGS += -DNDEBUG
endif endif
ifeq ($(PROFILE),yes) ifeq ($(PROFILE),yes)
@ -33,6 +34,10 @@ ifneq (,$(wildcard *.gcda mods/*.gcda))
dummy := $(shell $(RM) rosella $(OBJS)) dummy := $(shell $(RM) rosella $(OBJS))
endif endif
CPPFLAGS += $(EXTRA_CPPFLAGS)
CFLAGS += $(EXTRA_CFLAGS)
LDFLAGS += $(EXTRA_LDFLAGS)
all: rosella all: rosella
depend: $(DEPS) depend: $(DEPS)

7
gc.c
View File

@ -837,8 +837,11 @@ static void _collect_garbage(size_t min_free)
} while (gc_max_size < need_bytes); } while (gc_max_size < need_bytes);
/* Reallocate the unused space. */ /* 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. */ /* See if reallocation succeeded. */
if (!gc_ranges[gc_other_range()]) if (!gc_ranges[gc_other_range()])