MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / jit_str_cat

Function jit_str_cat

src/builtin/module_jit.cpp:454–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452 }
453
454 DAS_API char * jit_str_cat ( const char * sA, const char * sB, Context * context, LineInfoArg * at ) {
455 sA = sA ? sA : "";
456 sB = sB ? sB : "";
457 auto la = stringLength(*context, sA);
458 auto lb = stringLength(*context, sB);
459 uint32_t commonLength = la + lb;
460 if ( !commonLength ) {
461 return nullptr;
462 } else {
463 char * sAB = (char * ) context->allocateString(nullptr, commonLength, at);
464 memcpy ( sAB, sA, la );
465 memcpy ( sAB+la, sB, lb+1 );
466 context->stringHeap->recognize(sAB);
467 return sAB;
468 }
469 }
470
471 struct JitStackState {
472 char * EP;

Callers

nothing calls this directly

Calls 3

stringLengthFunction · 0.85
allocateStringMethod · 0.80
recognizeMethod · 0.80

Tested by

no test coverage detected