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

Function fxMarkFinalizationRegistry

xs/sources/xsMemory.c:854–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

852#endif
853
854void fxMarkFinalizationRegistry(txMachine* the, txSlot* registry)
855{
856 txSlot* slot = registry->value.finalizationRegistry.callback->next;
857 txSlot* instance;
858 while (slot) {
859 slot = slot->next;
860 if (slot) {
861 instance = slot->value.finalizationCell.target;
862 if (instance && !(instance->flag & XS_MARK_FLAG)) {
863 slot->value.finalizationCell.target = C_NULL;
864 registry->value.finalizationRegistry.flags |= XS_FINALIZATION_REGISTRY_CHANGED;
865 }
866 instance = slot->value.finalizationCell.token;
867 if (instance && !(instance->flag & XS_MARK_FLAG))
868 slot->value.finalizationCell.token = C_NULL;
869 slot = slot->next;
870 }
871 }
872}
873
874void fxMarkInstance(txMachine* the, txSlot* theCurrent, void (*theMarker)(txMachine*, txSlot*))
875{

Callers 1

fxMarkWeakStuffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected