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

Function fxStringifyJSONCharacter

xs/sources/xsJSON.c:871–884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

869}
870
871void fxStringifyJSONCharacter(txMachine* the, txJSONStringifier* theStringifier, txInteger character)
872{
873 txSize size = mxStringByteLength(character);
874 if ((theStringifier->offset + size) >= theStringifier->size) {
875 char* aBuffer;
876 theStringifier->size += ((size / 1024) + 1) * 1024;
877 aBuffer = c_realloc(theStringifier->buffer, theStringifier->size);
878 if (!aBuffer)
879 fxAbort(the, XS_NOT_ENOUGH_MEMORY_EXIT);
880 theStringifier->buffer = aBuffer;
881 }
882 mxStringByteEncode(theStringifier->buffer + theStringifier->offset, character);
883 theStringifier->offset += size;
884}
885
886void fxStringifyJSONChars(txMachine* the, txJSONStringifier* theStringifier, char* s, txSize theSize)
887{

Callers 1

fxStringifyJSONStringFunction · 0.85

Calls 1

fxAbortFunction · 0.70

Tested by

no test coverage detected