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

Function fxMeasureKey

xs/sources/xsMarshall.c:784–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782}
783
784txBoolean fxMeasureKey(txMachine* the, txID id, txMarshallBuffer* theBuffer, txBoolean alien)
785{
786 txSlot* key;
787 txSize length;
788 if (id == XS_NO_ID)
789 return 1;
790 if (alien) {
791 if (theBuffer->symbolMap[id])
792 return 1;
793 key = fxGetKey(the, id);
794 if (!(key->flag & XS_DONT_ENUM_FLAG))
795 return 0;
796 }
797 else if (id >= the->keyOffset) {
798 if (theBuffer->symbolMap[id - the->keyOffset])
799 return 1;
800 key = fxGetKey(the, id);
801 if (!(key->flag & XS_DONT_ENUM_FLAG))
802 return 0;
803 id -= the->keyOffset;
804 }
805 else
806 return 1;
807 length = mxStringLength(key->value.key.string) + 1;
808 theBuffer->symbolMap[id] = (txID)length;
809 theBuffer->symbolSize += sizeof(txID);
810 theBuffer->symbolSize += length;
811 theBuffer->symbolCount++;
812 return 1;
813}
814
815void fxMeasureReference(txMachine* the, txSlot* theSlot, txMarshallBuffer* theBuffer, txBoolean alien)
816{

Callers 1

fxMeasureSlotFunction · 0.85

Calls 1

fxGetKeyFunction · 0.85

Tested by

no test coverage detected