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