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

Function fxNewChunk

xs/sources/xsMemory.c:1657–1671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1655}
1656
1657void* fxNewChunk(txMachine* the, txSize size)
1658{
1659 txSize offset = size;
1660 txChunk* chunk;
1661 txBoolean once = 1;
1662 size = fxAdjustChunkSize(the, size);
1663 chunk = fxFindChunk(the, size, &once);
1664 if (!chunk) {
1665 chunk = fxGrowChunk(the, size);
1666 }
1667#ifdef mxMetering
1668 the->meterIndex += size * XS_CHUNK_ALLOCATION_METERING;
1669#endif
1670 return fxCheckChunk(the, chunk, size, offset);
1671}
1672
1673void* fxNewGrowableChunk(txMachine* the, txSize size, txSize capacity)
1674{

Callers 15

fx_parseURLFunction · 0.85
fx_parseURLEncodeFunction · 0.85
fx_parseURLPercentEncodeFunction · 0.85
fx_parseURLPushPathFunction · 0.85
fx_parseURLSetPartFunction · 0.85
fx_parseQueryPlusFunction · 0.85
fx_serializeQueryPlusFunction · 0.85
_appendPathFunction · 0.85
_appendPathFunction · 0.85
PiuTextBufferAppendFunction · 0.85

Calls 4

fxAdjustChunkSizeFunction · 0.85
fxFindChunkFunction · 0.85
fxGrowChunkFunction · 0.85
fxCheckChunkFunction · 0.85

Tested by

no test coverage detected