fix gc_trace flag
This commit is contained in:
parent
c104fb946d
commit
0eac6ac20b
38
C/heapgc.c
38
C/heapgc.c
@ -1,4 +1,4 @@
|
||||
/*************************************************************************
|
||||
/**************************************************************************
|
||||
* *
|
||||
* YAP Prolog *
|
||||
* *
|
||||
@ -45,15 +45,15 @@ static void mark_db_fixed(CELL * CACHE_TYPE);
|
||||
static void mark_regs(tr_fr_ptr CACHE_TYPE);
|
||||
static void mark_trail(tr_fr_ptr, tr_fr_ptr, CELL *, choiceptr CACHE_TYPE);
|
||||
static void mark_environments(CELL *, size_t, CELL * CACHE_TYPE);
|
||||
static void mark_choicepoints(choiceptr, tr_fr_ptr, int CACHE_TYPE);
|
||||
static void mark_choicepoints(choiceptr, tr_fr_ptr, bool CACHE_TYPE);
|
||||
static void into_relocation_chain(CELL *, CELL * CACHE_TYPE);
|
||||
static void sweep_trail(choiceptr, tr_fr_ptr CACHE_TYPE);
|
||||
static void sweep_environments(CELL *, size_t, CELL * CACHE_TYPE);
|
||||
static void sweep_choicepoints(choiceptr CACHE_TYPE);
|
||||
static void compact_heap( CACHE_TYPE1 );
|
||||
static void update_relocation_chain(CELL *, CELL * CACHE_TYPE);
|
||||
static int is_gc_verbose(void);
|
||||
static int is_gc_very_verbose(void);
|
||||
static bool is_gc_verbose(void);
|
||||
static bool is_gc_very_verbose(void);
|
||||
static void LeaveGCMode( CACHE_TYPE1 );
|
||||
#ifdef EASY_SHUNTING
|
||||
static void set_conditionals(tr_fr_ptr CACHE_TYPE);
|
||||
@ -1971,7 +1971,7 @@ youngest_cp(choiceptr gc_B, dep_fr_ptr *depfrp)
|
||||
|
||||
|
||||
static void
|
||||
mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose USES_REGS)
|
||||
mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, bool very_verbose USES_REGS)
|
||||
{
|
||||
OPCODE
|
||||
trust_lu = Yap_opcode(_trust_logical),
|
||||
@ -3908,7 +3908,7 @@ compaction_phase(tr_fr_ptr old_TR, CELL *current_env, yamop *curp USES_REGS)
|
||||
if (CurrentH0) {
|
||||
H0 = CurrentH0;
|
||||
#ifdef TABLING
|
||||
/* make sure that we have the correct H_FZ if we're not tabling */
|
||||
/* make sure that we havce the correct H_FZ if we're not tabling */
|
||||
if (B_FZ == (choiceptr)LCL0)
|
||||
H_FZ = H0;
|
||||
#endif /* TABLING */
|
||||
@ -3923,7 +3923,7 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop USES_REGS)
|
||||
volatile tr_fr_ptr old_TR = NULL;
|
||||
UInt m_time, c_time, time_start, gc_time;
|
||||
Int effectiveness, tot;
|
||||
int gc_trace;
|
||||
bool gc_trace;
|
||||
UInt gc_phase;
|
||||
UInt alloc_sz;
|
||||
int jmp_res;
|
||||
@ -3931,7 +3931,7 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop USES_REGS)
|
||||
heap_cells = HR-H0;
|
||||
gc_verbose = is_gc_verbose();
|
||||
effectiveness = 0;
|
||||
gc_trace = FALSE;
|
||||
gc_trace = false;
|
||||
LOCAL_GcCalls++;
|
||||
#ifdef INSTRUMENT_GC
|
||||
{
|
||||
@ -3956,8 +3956,8 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop USES_REGS)
|
||||
#ifdef DEBUG
|
||||
check_global();
|
||||
#endif
|
||||
if (Yap_GetValue(AtomGcTrace) != TermNil)
|
||||
gc_trace = 1;
|
||||
if (gcTrace() != TermOff)
|
||||
gc_trace = true;
|
||||
if (gc_trace) {
|
||||
fprintf(stderr, "%% gc\n");
|
||||
} else if (gc_verbose) {
|
||||
@ -4130,34 +4130,34 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop USES_REGS)
|
||||
return effectiveness;
|
||||
}
|
||||
|
||||
static int
|
||||
static bool
|
||||
is_gc_verbose(void)
|
||||
{
|
||||
CACHE_REGS
|
||||
if (LOCAL_PrologMode == BootMode)
|
||||
return FALSE;
|
||||
return false;
|
||||
#ifdef INSTRUMENT_GC
|
||||
/* always give info when we are debugging gc */
|
||||
return(TRUE);
|
||||
return true;
|
||||
#else
|
||||
return(Yap_GetValue(AtomGcVerbose) != TermNil ||
|
||||
Yap_GetValue(AtomGcVeryVerbose) != TermNil);
|
||||
Term t = gcTrace();
|
||||
return t == TermVerbose || t == TermVeryVerbose;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
bool
|
||||
Yap_is_gc_verbose(void)
|
||||
{
|
||||
return is_gc_verbose();
|
||||
}
|
||||
|
||||
static int
|
||||
static bool
|
||||
is_gc_very_verbose(void)
|
||||
{
|
||||
CACHE_REGS
|
||||
if (LOCAL_PrologMode == BootMode)
|
||||
return FALSE;
|
||||
return Yap_GetValue(AtomGcVeryVerbose) != TermNil;
|
||||
return false;
|
||||
return gcTrace() == TermVeryVerbose;
|
||||
}
|
||||
|
||||
Int
|
||||
|
@ -342,6 +342,10 @@ static inline size_t indexingDepth(void) {
|
||||
return IntOfTerm(GLOBAL_Flags[INDEX_SUB_TERM_SEARCH_DEPTH_FLAG].at);
|
||||
}
|
||||
|
||||
static inline Term gcTrace(void) {
|
||||
return GLOBAL_Flags[GC_TRACE_FLAG].at;
|
||||
}
|
||||
|
||||
bool rmdot(Term inp);
|
||||
|
||||
xarg *Yap_ArgListToVector(Term listl, const param_t *def, int n);
|
||||
|
@ -254,7 +254,7 @@ void Yap_CopyThreadStacks(int, int, int);
|
||||
/* heapgc.c */
|
||||
Int Yap_total_gc_time(void);
|
||||
void Yap_init_gc(void);
|
||||
int Yap_is_gc_verbose(void);
|
||||
bool Yap_is_gc_verbose(void);
|
||||
int Yap_gc(Int, CELL *, yamop *);
|
||||
int Yap_locked_gc(Int, CELL *, yamop *);
|
||||
int Yap_gcl(UInt, Int, CELL *, yamop *);
|
||||
|
@ -405,8 +405,10 @@
|
||||
AtomVariableNames = Yap_LookupAtom("variable_names");
|
||||
AtomHiddenVar = Yap_FullLookupAtom("$V");
|
||||
AtomVariable = Yap_LookupAtom("variable");
|
||||
AtomVerbose = Yap_LookupAtom("verbose");
|
||||
AtomVerboseFileSearch = Yap_LookupAtom("verbose_file_search");
|
||||
AtomVersionNumber = Yap_FullLookupAtom("$version_name");
|
||||
AtomVeryVerbose = Yap_LookupAtom("very_verbose");
|
||||
AtomWakeUpGoal = Yap_FullLookupAtom("$wake_up_goal");
|
||||
AtomWarning = Yap_LookupAtom("warning");
|
||||
AtomWhen = Yap_FullLookupAtom("$when");
|
||||
|
@ -405,8 +405,10 @@
|
||||
AtomVariableNames = AtomAdjust(AtomVariableNames);
|
||||
AtomHiddenVar = AtomAdjust(AtomHiddenVar);
|
||||
AtomVariable = AtomAdjust(AtomVariable);
|
||||
AtomVerbose = AtomAdjust(AtomVerbose);
|
||||
AtomVerboseFileSearch = AtomAdjust(AtomVerboseFileSearch);
|
||||
AtomVersionNumber = AtomAdjust(AtomVersionNumber);
|
||||
AtomVeryVerbose = AtomAdjust(AtomVeryVerbose);
|
||||
AtomWakeUpGoal = AtomAdjust(AtomWakeUpGoal);
|
||||
AtomWarning = AtomAdjust(AtomWarning);
|
||||
AtomWhen = AtomAdjust(AtomWhen);
|
||||
|
@ -1211,12 +1211,18 @@
|
||||
Atom AtomVariable_;
|
||||
#define AtomVariable Yap_heap_regs->AtomVariable_
|
||||
#define TermVariable MkAtomTerm( Yap_heap_regs->AtomVariable_ )
|
||||
Atom AtomVerbose_;
|
||||
#define AtomVerbose Yap_heap_regs->AtomVerbose_
|
||||
#define TermVerbose MkAtomTerm( Yap_heap_regs->AtomVerbose_ )
|
||||
Atom AtomVerboseFileSearch_;
|
||||
#define AtomVerboseFileSearch Yap_heap_regs->AtomVerboseFileSearch_
|
||||
#define TermVerboseFileSearch MkAtomTerm( Yap_heap_regs->AtomVerboseFileSearch_ )
|
||||
Atom AtomVersionNumber_;
|
||||
#define AtomVersionNumber Yap_heap_regs->AtomVersionNumber_
|
||||
#define TermVersionNumber MkAtomTerm( Yap_heap_regs->AtomVersionNumber_ )
|
||||
Atom AtomVeryVerbose_;
|
||||
#define AtomVeryVerbose Yap_heap_regs->AtomVeryVerbose_
|
||||
#define TermVeryVerbose MkAtomTerm( Yap_heap_regs->AtomVeryVerbose_ )
|
||||
Atom AtomWakeUpGoal_;
|
||||
#define AtomWakeUpGoal Yap_heap_regs->AtomWakeUpGoal_
|
||||
#define TermWakeUpGoal MkAtomTerm( Yap_heap_regs->AtomWakeUpGoal_ )
|
||||
|
Reference in New Issue
Block a user