garbage collector was not asking for space.
avoid 0 sized calls to mmap. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2058 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
817663588d
commit
e353d8811f
@ -194,7 +194,7 @@ yapsbrk(long size)
|
|||||||
{
|
{
|
||||||
ADDR newHeapTop = HeapTop, oldHeapTop = HeapTop;
|
ADDR newHeapTop = HeapTop, oldHeapTop = HeapTop;
|
||||||
newHeapTop = HeapTop+size;
|
newHeapTop = HeapTop+size;
|
||||||
if (Yap_NOfMemoryHoles && newHeapTop > Yap_MemoryHoles[0].start) {
|
while (Yap_NOfMemoryHoles && newHeapTop > Yap_MemoryHoles[0].start) {
|
||||||
UInt i;
|
UInt i;
|
||||||
|
|
||||||
HeapTop = oldHeapTop = Yap_MemoryHoles[0].end;
|
HeapTop = oldHeapTop = Yap_MemoryHoles[0].end;
|
||||||
|
@ -377,6 +377,8 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
|
|||||||
int psize = YAP_BUF_SIZE;
|
int psize = YAP_BUF_SIZE;
|
||||||
|
|
||||||
Yap_Error_TYPE = YAP_NO_ERROR;
|
Yap_Error_TYPE = YAP_NO_ERROR;
|
||||||
|
if (where == 0L)
|
||||||
|
where = TermNil;
|
||||||
#if DEBUG_STRICT
|
#if DEBUG_STRICT
|
||||||
if (Yap_heap_regs && !(Yap_PrologMode & BootMode))
|
if (Yap_heap_regs && !(Yap_PrologMode & BootMode))
|
||||||
fprintf(stderr,"***** Processing Error %d (%lx,%x) %s***\n", type, (unsigned long int)ActiveSignals,Yap_PrologMode,format);
|
fprintf(stderr,"***** Processing Error %d (%lx,%x) %s***\n", type, (unsigned long int)ActiveSignals,Yap_PrologMode,format);
|
||||||
|
15
C/grow.c
15
C/grow.c
@ -631,6 +631,8 @@ static_growheap(long size, int fix_code, struct intermediates *cip, tr_fr_ptr *o
|
|||||||
|
|
||||||
CurrentDelayTop = (CELL *)DelayTop();
|
CurrentDelayTop = (CELL *)DelayTop();
|
||||||
/* adjust to a multiple of 256) */
|
/* adjust to a multiple of 256) */
|
||||||
|
if (size < YAP_ALLOC_SIZE)
|
||||||
|
size = YAP_ALLOC_SIZE;
|
||||||
size = AdjustPageSize(size);
|
size = AdjustPageSize(size);
|
||||||
Yap_ErrorMessage = NULL;
|
Yap_ErrorMessage = NULL;
|
||||||
if (!Yap_ExtendWorkSpace(size)) {
|
if (!Yap_ExtendWorkSpace(size)) {
|
||||||
@ -734,6 +736,8 @@ static_growglobal(long size, CELL **ptr, CELL *hsplit)
|
|||||||
if (size < ((char *)H0-omax)/8)
|
if (size < ((char *)H0-omax)/8)
|
||||||
size = ((char *)H0-omax)/8;
|
size = ((char *)H0-omax)/8;
|
||||||
if (do_grow) {
|
if (do_grow) {
|
||||||
|
if (size < YAP_ALLOC_SIZE)
|
||||||
|
size = YAP_ALLOC_SIZE;
|
||||||
size = AdjustPageSize(size);
|
size = AdjustPageSize(size);
|
||||||
}
|
}
|
||||||
/* adjust to a multiple of 256) */
|
/* adjust to a multiple of 256) */
|
||||||
@ -1073,8 +1077,11 @@ do_growheap(int fix_code, UInt in_size, struct intermediates *cip, tr_fr_ptr *ol
|
|||||||
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"cannot grow Heap: more than a worker/thread running");
|
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"cannot grow Heap: more than a worker/thread running");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
if (SizeOfOverflow > sz)
|
if (SizeOfOverflow > sz) {
|
||||||
|
if (size < YAP_ALLOC_SIZE)
|
||||||
|
size = YAP_ALLOC_SIZE;
|
||||||
sz = AdjustPageSize(SizeOfOverflow);
|
sz = AdjustPageSize(SizeOfOverflow);
|
||||||
|
}
|
||||||
while(sz >= sizeof(CELL) * 16 * 1024L && !static_growheap(sz, fix_code, cip, old_trp, tksp, vep)) {
|
while(sz >= sizeof(CELL) * 16 * 1024L && !static_growheap(sz, fix_code, cip, old_trp, tksp, vep)) {
|
||||||
size = size/2;
|
size = size/2;
|
||||||
sz = size << shift_factor;
|
sz = size << shift_factor;
|
||||||
@ -1397,6 +1404,8 @@ growstack(long size)
|
|||||||
int gc_verbose;
|
int gc_verbose;
|
||||||
|
|
||||||
/* adjust to a multiple of 256) */
|
/* adjust to a multiple of 256) */
|
||||||
|
if (size < YAP_ALLOC_SIZE)
|
||||||
|
size = YAP_ALLOC_SIZE;
|
||||||
size = AdjustPageSize(size);
|
size = AdjustPageSize(size);
|
||||||
Yap_ErrorMessage = NULL;
|
Yap_ErrorMessage = NULL;
|
||||||
start_growth_time = Yap_cputime();
|
start_growth_time = Yap_cputime();
|
||||||
@ -1477,8 +1486,8 @@ static int do_growtrail(long size, int contiguous_only, int in_parser, tr_fr_ptr
|
|||||||
if (!size)
|
if (!size)
|
||||||
size = ((ADDR)TR-Yap_TrailBase);
|
size = ((ADDR)TR-Yap_TrailBase);
|
||||||
size *= 2;
|
size *= 2;
|
||||||
if (size < 64*1024)
|
if (size < YAP_ALLOC_SIZE)
|
||||||
size = 64*1024;
|
size = YAP_ALLOC_SIZE;
|
||||||
if (size > 2048*1024)
|
if (size > 2048*1024)
|
||||||
size = 2048*1024;
|
size = 2048*1024;
|
||||||
/* adjust to a multiple of 256) */
|
/* adjust to a multiple of 256) */
|
||||||
|
@ -3867,8 +3867,10 @@ call_gc(UInt gc_lim, Int predarity, CELL *current_env, yamop *nextop)
|
|||||||
/* expand the stack if effectiveness is less than 20 % */
|
/* expand the stack if effectiveness is less than 20 % */
|
||||||
if (ASP - H < gc_margin/sizeof(CELL) ||
|
if (ASP - H < gc_margin/sizeof(CELL) ||
|
||||||
effectiveness < 20) {
|
effectiveness < 20) {
|
||||||
|
UInt sz;
|
||||||
|
|
||||||
LeaveGCMode();
|
LeaveGCMode();
|
||||||
return Yap_growstack(gc_margin-((ASP-H)*sizeof(CELL)));
|
return Yap_growstack(gc_margin);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* debug for(save_total=1; save_total<=N; ++save_total)
|
* debug for(save_total=1; save_total<=N; ++save_total)
|
||||||
|
11
C/index.c
11
C/index.c
@ -11,8 +11,12 @@
|
|||||||
* File: index.c *
|
* File: index.c *
|
||||||
* comments: Indexing a Prolog predicate *
|
* comments: Indexing a Prolog predicate *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2008-01-23 17:57:46 $,$Author: vsc $ *
|
* Last rev: $Date: 2008-01-24 00:11:59 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.193 2008/01/23 17:57:46 vsc
|
||||||
|
* valgrind it!
|
||||||
|
* enable atom garbage collection.
|
||||||
|
*
|
||||||
* Revision 1.192 2007/11/26 23:43:08 vsc
|
* Revision 1.192 2007/11/26 23:43:08 vsc
|
||||||
* fixes to support threads and assert correctly, even if inefficiently.
|
* fixes to support threads and assert correctly, even if inefficiently.
|
||||||
*
|
*
|
||||||
@ -4767,7 +4771,10 @@ Yap_PredIsIndexable(PredEntry *ap, UInt NSlots)
|
|||||||
if ((setjres = setjmp(cint.CompilerBotch)) == 3) {
|
if ((setjres = setjmp(cint.CompilerBotch)) == 3) {
|
||||||
restore_machine_regs();
|
restore_machine_regs();
|
||||||
recover_from_failed_susp_on_cls(&cint, 0);
|
recover_from_failed_susp_on_cls(&cint, 0);
|
||||||
Yap_gcl(Yap_Error_Size, ap->ArityOfPE+NSlots, ENV, CP);
|
if (!Yap_gcl(Yap_Error_Size, ap->ArityOfPE+NSlots, ENV, CP)) {
|
||||||
|
Yap_Error(OUT_OF_STACK_ERROR, TermNil, Yap_ErrorMessage);
|
||||||
|
return FAILCODE;
|
||||||
|
}
|
||||||
} else if (setjres == 2) {
|
} else if (setjres == 2) {
|
||||||
restore_machine_regs();
|
restore_machine_regs();
|
||||||
Yap_Error_Size = recover_from_failed_susp_on_cls(&cint, Yap_Error_Size);
|
Yap_Error_Size = recover_from_failed_susp_on_cls(&cint, Yap_Error_Size);
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<h2>Yap-5.1.3:</h2>
|
<h2>Yap-5.1.3:</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li> FIXED: make sure we don't ask for 0-sized blocks, minimal 64K.</li>
|
||||||
<li> FIXED: Aux reallocation should always increase aux size.</li>
|
<li> FIXED: Aux reallocation should always increase aux size.</li>
|
||||||
<li> NEW: start atom garbage collector by default (except for threads).</li>
|
<li> NEW: start atom garbage collector by default (except for threads).</li>
|
||||||
<li> FIXED: restore indices should run over the indices, and not mess
|
<li> FIXED: restore indices should run over the indices, and not mess
|
||||||
|
Reference in New Issue
Block a user