MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxDeleteMachine

Function fxDeleteMachine

xs/sources/xsAPI.c:1566–1612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1564}
1565
1566void fxDeleteMachine(txMachine* the)
1567{
1568 txSlot* aSlot;
1569#ifndef mxLink
1570 txSlot* bSlot;
1571 txSlot* cSlot;
1572#endif
1573
1574 if (!(the->shared)) {
1575 #ifdef mxFrequency
1576 fxReportFrequency(the);
1577 #endif
1578 #ifdef mxDebug
1579 fxLogout(the);
1580 #endif
1581 }
1582 the->context = C_NULL;
1583 aSlot = the->cRoot;
1584 while (aSlot) {
1585 aSlot->flag |= XS_MARK_FLAG;
1586 aSlot = aSlot->next;
1587 }
1588#ifndef mxLink
1589 aSlot = the->firstHeap;
1590 while (aSlot) {
1591 bSlot = aSlot + 1;
1592 cSlot = aSlot->value.reference;
1593 while (bSlot < cSlot) {
1594 if ((bSlot->kind == XS_HOST_KIND) && (bSlot->value.host.variant.destructor)) {
1595 if (bSlot->flag & XS_HOST_HOOKS_FLAG) {
1596 if (bSlot->value.host.variant.hooks->destructor)
1597 (*(bSlot->value.host.variant.hooks->destructor))(bSlot->value.host.data);
1598 }
1599 else
1600 (*(bSlot->value.host.variant.destructor))(bSlot->value.host.data);
1601 }
1602 bSlot++;
1603 }
1604 aSlot = aSlot->next;
1605 }
1606#endif
1607 fxDeleteMachinePlatform(the);
1608 if (gxDefaults.terminateSharedCluster)
1609 gxDefaults.terminateSharedCluster(the);
1610 fxFree(the);
1611 c_free(the);
1612}
1613
1614#if mxAliasInstance
1615txMachine* fxCloneMachine(txCreation* theCreation, txMachine* theMachine, txString theName, void* theContext)

Callers

nothing calls this directly

Calls 4

fxReportFrequencyFunction · 0.85
fxLogoutFunction · 0.85
fxFreeFunction · 0.85
fxDeleteMachinePlatformFunction · 0.70

Tested by

no test coverage detected