fix stack growth in globals

fix compilation messages


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2277 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2008-06-16 21:22:15 +00:00
parent 1340bc6f05
commit e90f744e5e
6 changed files with 33 additions and 9 deletions

View File

@ -1869,6 +1869,7 @@ p_nb_heap_add_to_heap(void)
CELL *qd = GetHeap(ARG1,"add_to_heap"), *oldH, *oldHB, *pt;
UInt hsize, hmsize, old_sz;
Term arena, to, key;
UInt mingrow;
if (!qd)
return FALSE;
@ -1879,7 +1880,7 @@ p_nb_heap_add_to_heap(void)
CELL *top = qd+(HEAP_START+2*hmsize);
UInt extra_size;
if (hmsize >= 64*1024) {
if (hmsize <= 64*1024) {
extra_size = 64*1024;
} else {
extra_size = hmsize;
@ -1913,9 +1914,10 @@ p_nb_heap_add_to_heap(void)
arena = qd[HEAP_ARENA];
if (arena == 0L)
return FALSE;
key = CopyTermToArena(ARG2, arena, FALSE, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, 0);
mingrow = garena_overflow_size(ArenaPt(arena));
key = CopyTermToArena(ARG2, arena, FALSE, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, mingrow);
arena = qd[HEAP_ARENA];
to = CopyTermToArena(ARG3, arena, FALSE, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, 0);
to = CopyTermToArena(ARG3, arena, FALSE, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, mingrow);
if (key == 0 || to == 0L)
return FALSE;
qd = GetHeap(ARG1,"add_to_heap");
@ -2295,6 +2297,7 @@ p_nb_beam_add_to_beam(void)
CELL *qd = GetHeap(ARG1,"add_to_beam"), *oldH, *oldHB, *pt;
UInt hsize, hmsize, old_sz;
Term arena, to, key;
UInt mingrow;
if (!qd)
return FALSE;
@ -2314,9 +2317,10 @@ p_nb_beam_add_to_beam(void)
arena = qd[HEAP_ARENA];
if (arena == 0L)
return FALSE;
key = CopyTermToArena(ARG2, qd[HEAP_ARENA], FALSE, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, 0);
mingrow = garena_overflow_size(ArenaPt(arena));
key = CopyTermToArena(ARG2, qd[HEAP_ARENA], FALSE, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, mingrow);
arena = qd[HEAP_ARENA];
to = CopyTermToArena(ARG3, arena, FALSE, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, 0);
to = CopyTermToArena(ARG3, arena, FALSE, 3, qd+HEAP_ARENA, qd+HEAP_DELAY_ARENA, mingrow);
if (key == 0 || to == 0L)
return FALSE;
qd = GetHeap(ARG1,"add_to_beam");

View File

@ -3703,7 +3703,7 @@ syntax_error (TokEntry * tokptr, int sno)
Int
Yap_FirstLineInParse (void)
{
return(StartLine);
return StartLine;
}
static Int

View File

@ -7072,6 +7072,12 @@ must be an atom (named array). The @var{Size} must evaluate to an
integer. The @var{Type} must be bound to one of types mentioned
previously.
@item reset_static_array(+@var{Name})
@findex reset_static_array/1
@snindex reset_static_array/1
@cnindex reset_static_array/1
Reset static array with name @var{Name} to its initial value.
@item static_array_location(+@var{Name}, -@var{Ptr})
@findex static_array_location/4
@snindex static_array_location/4
@ -9684,6 +9690,12 @@ Add an element with key @var{Key} and @var{Value} to the tree
@var{T0} creating a new red-black tree @var{TF}. Duplicated elements are not
allowed.
@snindex rb_insert_new/4
@cnindex rb_insert_new/4
Add a new element with key @var{Key} and @var{Value} to the tree
@var{T0} creating a new red-black tree @var{TF}. Fails is an element
with @var{Key} exists in the tree.
@item rb_lookup(+@var{Key},-@var{Value},+@var{T})
@findex rb_lookup/3
@snindex rb_lookup/3

View File

@ -104,7 +104,7 @@ true :- true.
nb_setval('$endif',off),
nb_setval('$consulting_file',[]),
nb_setval('$consulting',false),
nb_setval('$included_file','').
nb_setval('$included_file',[]).
% Start file for yap

View File

@ -11,7 +11,7 @@
* File: utilities for displaying messages in YAP. *
* comments: error messages for YAP *
* *
* Last rev: $Date: 2008-06-12 10:55:52 $,$Author: vsc $ *
* Last rev: $Date: 2008-06-16 21:22:15 $,$Author: vsc $ *
* *
* *
*************************************************************************/
@ -25,7 +25,7 @@
file_location(Prefix) -->
{
prolog_load_context(file, FileName)
},
},
{ '$start_line'(LN) },
file_position(FileName,LN,Prefix),
[ nl ].

View File

@ -134,6 +134,14 @@ key_statistics(Key, NOfEntries, TotalSize) :-
:- meta_predicate time(:).
time(Goal) :-
var(Goal),
'$do_error'(instantiation_error,time(Goal)).
time(_:Goal) :-
var(Goal),
'$do_error'(instantiation_error,time(Goal)).
time(Goal) :- \+ callable(Goal), !,
'$do_error'(type_error(callable,Goal),time(Goal)).
time(Goal) :-
statistics(walltime, _),
statistics(cputime, _),