Skip to content

Commit 6652284

Browse files
Fan LinFan Lin
authored andcommitted
using fxPrepareMachine
1 parent 2c2dba0 commit 6652284

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

  • build/devices/linemb/xsProj-glib

build/devices/linemb/xsProj-glib/main.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,30 +119,12 @@ int main(int argc, char *argv[]) {
119119
signal(SIGALRM, timeout_handler); // Used for timeout
120120

121121
int error = 0;
122-
static txMachine _root;
123-
txMachine *the = &_root;
124122
txPreparation *preparation = xsPreparation();
125123

126-
c_memset(the, 0, sizeof(txMachine));
127-
the->preparation = preparation;
128-
the->keyArray = preparation->keys;
129-
the->keyCount = (txID)preparation->keyCount + (txID)preparation->creation.initialKeyCount;
130-
the->keyIndex = (txID)preparation->keyCount;
131-
the->nameModulo = preparation->nameModulo;
132-
the->nameTable = preparation->names;
133-
the->symbolModulo = preparation->symbolModulo;
134-
the->symbolTable = preparation->symbols;
135-
136-
the->stack = &preparation->stack[0];
137-
the->stackBottom = &preparation->stack[0];
138-
the->stackTop = &preparation->stack[preparation->stackCount];
139-
140-
the->firstHeap = &preparation->heap[0];
141-
the->freeHeap = &preparation->heap[preparation->heapCount - 1];
142-
the->aliasCount = (txID)preparation->aliasCount;
124+
txMachine *the = fxPrepareMachine(NULL, preparation, "linemb", NULL, NULL);
143125

144126
setvbuf(stdout, NULL, _IONBF, 0);
145-
the = fxCloneMachine(&preparation->creation, the, "linemb", NULL);
127+
146128
gxMachine = the; // Save to thread-local storage
147129
#if mxInstrument
148130
fxDescribeInstrumentation(the, 0, NULL, NULL);

0 commit comments

Comments
 (0)