Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/gapstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ typedef struct GAPState {
#endif

/* From intrprtr.c */
UInt IntrIgnoring;
UInt IntrReturning;
UInt IntrCoding;
Obj IntrState;
Obj StackObj;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are removed from the global GAPState and put into a stack allocated IntrState.

WEll, all except STATE(IntrState) which itself became superfluous.

Obj Tilde;

// The current assertion level for use in Assert
Expand Down
9 changes: 5 additions & 4 deletions src/hpc/threadapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,15 @@ static GVarDescriptor GVarTHREAD_EXIT;

static void ThreadedInterpreter(void * funcargs)
{
IntrState intr = { 0, 0, 0, 0 };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allocate IntrState on the stack and use it below.

Obj tmp, func;
int i;

/* initialize everything and begin an interpreter */
STATE(NrError) = 0;
STATE(ThrownObject) = 0;

IntrBegin(STATE(BottomLVars));
IntrBegin(&intr, STATE(BottomLVars));
tmp = KEPTALIVE(funcargs);
StopKeepAlive(funcargs);
func = ELM_PLIST(tmp, 1);
Expand All @@ -461,13 +462,13 @@ static void ThreadedInterpreter(void * funcargs)
exit = GVarOptFunction(&GVarTHREAD_EXIT);
if (exit)
CALL_0ARGS(exit);
PushVoidObj();
PushVoidObj(&intr);
/* end the interpreter */
IntrEnd(0, NULL);
IntrEnd(&intr, 0, NULL);
}
CATCH_ERROR
{
IntrEnd(1, NULL);
IntrEnd(&intr, 1, NULL);
ClearError();
}
}
Expand Down
Loading