mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
fixing maximum heap heuristic
This commit is contained in:
parent
99d8c585f9
commit
420ab008ff
1 changed files with 1 additions and 1 deletions
2
gc.c
2
gc.c
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue