Exemplo n.º 1
0
void fxTerminateLinker(txLinker* linker)
{
	txLinkerChunk* block = linker->firstChunk;
	while (block) {
		txLinkerChunk* nextChunk = block->nextChunk;
		c_free(block);
		block = nextChunk;
	}
	if (linker->dtoa)
		fxDelete_dtoa(linker->dtoa);
}
Exemplo n.º 2
0
void fxTerminateParser(txParser* parser)
{
	fxDisposeParserChunks(parser);
	if (parser->dtoa)
		fxDelete_dtoa(parser->dtoa);
}
Exemplo n.º 3
0
void fxDeleteMachine(txMachine* the)
{
	txSlot* aSlot;
	txSlot* bSlot;
	txSlot* cSlot;

	if (!(the->shared)) {
	#ifdef mxProfile
		fxStopProfiling(the);
	#endif
	#ifdef mxFrequency
		fxReportFrequency(the);
	#endif
	#ifdef mxDebug
		fxLogout(the);
		//fxWriteBreakpoints(the);
	#endif
	}
	the->context = C_NULL;
	aSlot = the->cRoot;
	while (aSlot) {
		aSlot->flag |= XS_MARK_FLAG;
		aSlot = aSlot->next;
	}
	aSlot = the->firstHeap;
	while (aSlot) {
		bSlot = aSlot + 1;
		cSlot = aSlot->value.reference;
		while (bSlot < cSlot) {
			if ((bSlot->kind == XS_HOST_KIND) && (bSlot->value.host.variant.destructor)) {
				if (bSlot->flag & XS_HOST_HOOKS_FLAG) {
					if (bSlot->value.host.variant.hooks->destructor)
						(*(bSlot->value.host.variant.hooks->destructor))(bSlot->value.host.data);
				}
				else
					(*(bSlot->value.host.variant.destructor))(bSlot->value.host.data);
			}
			bSlot++;
		}
		aSlot = aSlot->next;
	}
	fxDelete_dtoa(the->dtoa);
	if (!(the->shared)) {
	#ifdef mxProfile
		if (the->profileBottom) {
			c_free(the->profileBottom);
			the->profileBottom = C_NULL;
			the->profileCurrent = C_NULL;
			the->profileTop = C_NULL;
		}
		if (the->profileDirectory) {
			c_free(the->profileDirectory);
		}
	#endif
	#ifdef mxDebug
		//fxDisconnect(the);
		if (the->sorter) {
			c_free(the->sorter);
			the->sorter = C_NULL;
		}
		if (the->echoBuffer) {
			c_free(the->echoBuffer);
			the->echoBuffer = C_NULL;
		}
	#endif
	}
#if __FSK_LAYER__
	FskInstrumentedItemDispose(the);
#endif
	fxFree(the);
	c_free(the);
}