fixing maximum heap heuristic

This commit is contained in:
Alex Shinn 2009-12-14 13:56:32 +09:00
parent 99d8c585f9
commit 420ab008ff

2
gc.c
View file

@ -222,7 +222,7 @@ void* sexp_alloc (sexp ctx, size_t size) {
h = sexp_heap_last(sexp_context_heap(ctx)); h = sexp_heap_last(sexp_context_heap(ctx));
if (((max_freed < size) if (((max_freed < size)
|| ((h->size - sum_freed) > (h->size*SEXP_GROW_HEAP_RATIO))) || ((h->size - sum_freed) > (h->size*SEXP_GROW_HEAP_RATIO)))
&& ((! SEXP_MAXIMUM_HEAP_SIZE) || (size < SEXP_MAXIMUM_HEAP_SIZE))) && ((! SEXP_MAXIMUM_HEAP_SIZE) || (h->size < SEXP_MAXIMUM_HEAP_SIZE)))
sexp_grow_heap(ctx, size); sexp_grow_heap(ctx, size);
res = sexp_try_alloc(ctx, size); res = sexp_try_alloc(ctx, size);
if (! res) if (! res)