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

Function fxConcatStringC

xs/sources/xsAll.c:221–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221txString fxConcatStringC(txMachine* the, txSlot* a, txString b)
222{
223 txSize aSize = mxStringLength(a->value.string);
224 txSize bSize = mxStringLength(b);
225 txSize resultSize = fxAddChunkSizes(the, fxAddChunkSizes(the, aSize, bSize), 1);
226 txString result = C_NULL;
227 if (a->kind == XS_STRING_KIND)
228 result = (txString)fxRenewChunk(the, a->value.string, resultSize);
229 if (!result) {
230 result = (txString)fxNewChunk(the, resultSize);
231 c_memcpy(result, a->value.string, aSize);
232 a->value.string = result;
233 a->kind = XS_STRING_KIND;
234 }
235 c_memcpy(result + aSize, b, bSize + 1);
236 return result;
237}
238
239txString fxCopyString(txMachine* the, txSlot* a, txSlot* b)
240{

Callers 15

fx_serializeURLFunction · 0.85
fx_serializeQueryFunction · 0.85
fx_GeneratorFunctionFunction · 0.85
fxSymbolToStringFunction · 0.85
fx_FunctionFunction · 0.85
fx_AsyncFunctionFunction · 0.85
fx_Error_toStringFunction · 0.85

Calls 2

fxRenewChunkFunction · 0.85
fxNewChunkFunction · 0.85

Tested by

no test coverage detected