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

Function fxGrowKeys

xs/sources/xsMemory.c:663–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663void fxGrowKeys(txMachine* the, txID theCount)
664{
665 if (the->keyDelta > 0) {
666 txID keyDelta = (theCount > the->keyDelta) ? theCount : the->keyDelta;
667 txID keyCount = (the->keyCount + keyDelta) - the->keyOffset;
668 txSlot** keyArray = c_realloc(the->keyArray, keyCount * sizeof(txSlot*));
669 if (keyArray == C_NULL)
670 fxAbort(the, XS_NOT_ENOUGH_MEMORY_EXIT);
671 the->keyArray = keyArray;
672 the->keyCount = keyCount + the->keyOffset;
673 }
674 else
675 fxAbort(the, XS_NO_MORE_KEYS_EXIT);
676}
677
678void fxGrowSlots(txMachine* the, txSize theCount)
679{

Callers 1

fxFindKeyFunction · 0.85

Calls 1

fxAbortFunction · 0.70

Tested by

no test coverage detected