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

Function fxCacheArray

xs/sources/xsArray.c:284–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void fxCacheArray(txMachine* the, txSlot* instance)
285{
286 txSlot* array = instance->next;
287 txIndex length = array->value.array.length;
288 if (length) {
289 txSlot* address = (txSlot *)fxNewChunk(the, fxMultiplyChunkSizes(the, length, sizeof(txSlot)));
290 txSlot* srcSlot = array->next;
291 txSlot* dstSlot = address;
292 txIndex index = 0;
293 while (srcSlot) {
294 dstSlot->next = C_NULL;
295 *((txIndex*)dstSlot) = index;
296 dstSlot->ID = XS_NO_ID;
297 dstSlot->flag = XS_NO_FLAG;
298 dstSlot->kind = srcSlot->kind;
299 dstSlot->value = srcSlot->value;
300 srcSlot = srcSlot->next;
301 dstSlot++;
302 index++;
303 }
304 array->value.array.address = address;
305 array->next = C_NULL;
306 }
307}
308
309txBoolean fxCallThisItem(txMachine* the, txSlot* function, txIndex index, txSlot* item)
310{

Callers 15

fx_Map_groupByFunction · 0.85
fx_AggregateErrorFunction · 0.85
fx_RegExp_prototype_execFunction · 0.85
fxSortArrayItemsFunction · 0.85
fx_Object_entriesFunction · 0.85
fx_Object_groupByFunction · 0.85

Calls 1

fxNewChunkFunction · 0.85

Tested by

no test coverage detected