make sure we never ask for less than what we were asked for (growtrail).

This commit is contained in:
Vitor Santos Costa 2010-03-30 09:15:02 +01:00
parent ca31e9fad8
commit 394b3e08e1
1 changed files with 4 additions and 1 deletions

View File

@ -1655,6 +1655,7 @@ static int do_growtrail(long size, int contiguous_only, int in_parser, tr_fr_ptr
{
UInt start_growth_time = Yap_cputime(), growth_time;
int gc_verbose = Yap_is_gc_verbose();
long size0 = size;
#if USE_SYSTEM_MALLOC
if (contiguous_only)
@ -1668,6 +1669,8 @@ static int do_growtrail(long size, int contiguous_only, int in_parser, tr_fr_ptr
size = YAP_ALLOC_SIZE;
if (size > 2048*1024)
size = 2048*1024;
if (size < size0)
size=size0;
/* adjust to a multiple of 256) */
size = AdjustPageSize(size);
trail_overflows++;