| 686 | unsigned int __stdcall fx_agent_start_aux(void* it) |
| 687 | #else |
| 688 | void* fx_agent_start_aux(void* it) |
| 689 | #endif |
| 690 | { |
| 691 | xsCreation creation = { |
| 692 | 16 * 1024 * 1024, /* initialChunkSize */ |
| 693 | 16 * 1024 * 1024, /* incrementalChunkSize */ |
| 694 | 1 * 1024 * 1024, /* initialHeapCount */ |
| 695 | 1 * 1024 * 1024, /* incrementalHeapCount */ |
| 696 | 4096, /* stackCount */ |
| 697 | 1024, /* initialKeyCount */ |
| 698 | 1024, /* incrementalKeyCount */ |
| 699 | 1993, /* nameModulo */ |
| 700 | 127, /* symbolModulo */ |
| 701 | 64 * 1024, /* parserBufferSize */ |
| 702 | 1993, /* parserTableModulo */ |
| 703 | }; |
| 704 | txAgent* agent = it; |
| 705 | xsMachine* machine = xsCreateMachine(&creation, "xst-agent", NULL); |
| 706 | xsBeginHost(machine); |
| 707 | { |
| 708 | xsTry { |
| 709 | txSlot* slot; |
| 710 | txSlot* global; |
| 711 | txStringCStream stream; |
| 712 | |
| 713 | mxPush(mxGlobal); |
| 714 | global = the->stack; |
| 715 | |
| 716 | slot = fxLastProperty(the, fxNewHostObject(the, NULL)); |
| 717 | slot = fxNextHostFunctionProperty(the, slot, fx_agent_leaving, 0, xsID("leaving"), XS_DONT_ENUM_FLAG); |
| 718 | slot = fxNextHostFunctionProperty(the, slot, fx_agent_monotonicNow, 0, xsID("monotonicNow"), XS_DONT_ENUM_FLAG); |
| 719 | slot = fxNextHostFunctionProperty(the, slot, fx_agent_receiveBroadcast, 1, xsID("receiveBroadcast"), XS_DONT_ENUM_FLAG); |
| 720 | slot = fxNextHostFunctionProperty(the, slot, fx_agent_report, 1, xsID("report"), XS_DONT_ENUM_FLAG); |
| 721 | slot = fxNextHostFunctionProperty(the, slot, fx_agent_sleep, 1, xsID("sleep"), XS_DONT_ENUM_FLAG); |
| 722 | fxSetHostData(the, the->stack, agent); |
| 723 | |
| 724 | mxPush(mxObjectPrototype); |
| 725 | slot = fxLastProperty(the, fxNewObjectInstance(the)); |
| 726 | slot = fxNextSlotProperty(the, slot, the->stack + 1, xsID("agent"), XS_GET_ONLY); |
| 727 | |
| 728 | slot = fxLastProperty(the, fxToInstance(the, global)); |
| 729 | slot = fxNextSlotProperty(the, slot, the->stack, xsID("$262"), XS_GET_ONLY); |
| 730 | |
| 731 | mxPop(); |
| 732 | mxPop(); |
| 733 | mxPop(); |
| 734 | |
| 735 | stream.buffer = agent->script; |
| 736 | stream.offset = 0; |
| 737 | stream.size = agent->scriptLength; |
| 738 | fxRunScript(the, fxParseScript(the, &stream, fxStringCGetter, mxProgramFlag), mxThis, C_NULL, C_NULL, C_NULL, mxProgram.value.reference); |
| 739 | fxRunLoop(the); |
| 740 | } |
| 741 | xsCatch { |
| 742 | } |
| 743 | } |
| 744 | xsEndHost(the); |
| 745 | xsDeleteMachine(machine); |
nothing calls this directly
no test coverage detected