fix inityaamregs not to destroy global structures.

This commit is contained in:
Vítor Santos Costa 2014-08-18 01:25:55 -05:00
parent 55910b4610
commit 6f88083d38

View File

@ -1795,7 +1795,6 @@ Yap_InitYaamRegs( int myworker_id )
CalculateStackGap( PASS_REGS1 ); CalculateStackGap( PASS_REGS1 );
/* the first real choice-point will also have AP=FAIL */ /* the first real choice-point will also have AP=FAIL */
/* always have an empty slots for people to use */ /* always have an empty slots for people to use */
REMOTE_GlobalArena(myworker_id) = TermNil;
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
LOCAL = REMOTE(myworker_id); LOCAL = REMOTE(myworker_id);
worker_id = myworker_id; worker_id = myworker_id;
@ -1814,8 +1813,12 @@ Yap_InitYaamRegs( int myworker_id )
PP = NULL; PP = NULL;
PREG_ADDR = NULL; PREG_ADDR = NULL;
#endif #endif
Yap_AllocateDefaultArena(128*1024, 2, myworker_id); if (REMOTE_GlobalArena(myworker_id) == 0L ||
Yap_InitPreAllocCodeSpace( myworker_id ); REMOTE_GlobalArena(myworker_id) == TermNil) {
REMOTE_GlobalArena(myworker_id) = TermNil;
Yap_AllocateDefaultArena(128*1024, 2, myworker_id);
Yap_InitPreAllocCodeSpace( myworker_id );
}
cut_c_initialize( myworker_id ); cut_c_initialize( myworker_id );
Yap_PrepGoal(0, NULL, NULL PASS_REGS); Yap_PrepGoal(0, NULL, NULL PASS_REGS);
#ifdef TABLING #ifdef TABLING