make sure we never ask for less than what we were asked for (growtrail).
This commit is contained in:
parent
ca31e9fad8
commit
394b3e08e1
3
C/grow.c
3
C/grow.c
@ -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;
|
UInt start_growth_time = Yap_cputime(), growth_time;
|
||||||
int gc_verbose = Yap_is_gc_verbose();
|
int gc_verbose = Yap_is_gc_verbose();
|
||||||
|
long size0 = size;
|
||||||
|
|
||||||
#if USE_SYSTEM_MALLOC
|
#if USE_SYSTEM_MALLOC
|
||||||
if (contiguous_only)
|
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;
|
size = YAP_ALLOC_SIZE;
|
||||||
if (size > 2048*1024)
|
if (size > 2048*1024)
|
||||||
size = 2048*1024;
|
size = 2048*1024;
|
||||||
|
if (size < size0)
|
||||||
|
size=size0;
|
||||||
/* adjust to a multiple of 256) */
|
/* adjust to a multiple of 256) */
|
||||||
size = AdjustPageSize(size);
|
size = AdjustPageSize(size);
|
||||||
trail_overflows++;
|
trail_overflows++;
|
||||||
|
Reference in New Issue
Block a user