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

Function fxArrayCacheEnd

xs/sources/xsAPI.c:493–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493void fxArrayCacheEnd(txMachine* the, txSlot* reference)
494{
495 txSlot* array = reference->value.reference->next;
496 txIndex length = array->value.array.length;
497 if (length) {
498 txSlot *srcSlot, *dstSlot;
499 array->value.array.address = (txSlot*)fxNewChunk(the, fxMultiplyChunkSizes(the, length, sizeof(txSlot)));
500 srcSlot = array->next;
501 dstSlot = array->value.array.address + length;
502 while (srcSlot) {
503 dstSlot--;
504 length--;
505 dstSlot->next = C_NULL;
506 dstSlot->ID = XS_NO_ID;
507 dstSlot->flag = XS_NO_FLAG;
508 dstSlot->kind = srcSlot->kind;
509 dstSlot->value = srcSlot->value;
510 *((txIndex*)dstSlot) = length;
511 srcSlot = srcSlot->next;
512 }
513 array->next = C_NULL;
514 }
515}
516
517void fxArrayCacheItem(txMachine* the, txSlot* reference, txSlot* item)
518{

Callers 3

fxLinkerScriptCallbackFunction · 0.85
fxBuildHostsFunction · 0.85

Calls 1

fxNewChunkFunction · 0.85

Tested by

no test coverage detected