RebootSlots when we start a new execution.

This commit is contained in:
Vítor Santos Costa 2015-02-10 09:19:05 +00:00
parent 081b2a464e
commit ab41d5411e
3 changed files with 13 additions and 2 deletions

@ -3204,7 +3204,7 @@ YAP_Reset(yap_reset_t mode)
/* always have an empty slots for people to use */
P = CP = YESCODE;
// ensure that we have slots where we need them
Yap_CloseSlots(1);
Yap_RebootSlots( worker_id );
RECOVER_MACHINE_REGS();
return res;
}

@ -1844,7 +1844,7 @@ Yap_InitYaamRegs( int myworker_id )
h0var = MkVarTerm();
REMOTE_AttsMutableList(myworker_id) = Yap_NewTimedVar(h0var);
#endif
REMOTE_CurSlot(myworker_id) = 1; /* This function has direct access to the Handles class AKA InitSlot */
Yap_RebootSlots( myworker_id );
h0var = MkVarTerm();
REMOTE_GcGeneration(myworker_id) = Yap_NewTimedVar(h0var);
REMOTE_GcCurrentPhase(myworker_id) = 0L;

@ -48,6 +48,17 @@ Slots are not known to the yaam. Instead, A new set of slots is created when the
*************************************************************************************************/
/// @brief reboot the slot system.
/// Used when wwe start from scratch (Reset).
#define Yap_RebootSlots( wid ) Yap_RebootSlots__( wid PASS_REGS )
static inline void
Yap_RebootSlots__( int wid USES_REGS ) {
// fprintf( stderr, " StartSlots = %ld", LOCAL_CurSlot);
REMOTE_CurSlot(wid) = 1;
}
/// @brief declares a new set of slots.
/// Used to tell how many slots we had when we entered a segment of code.
#define Yap_StartSlots() Yap_StartSlots__( PASS_REGS1 )