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

Method eval

src/simulate/runtime_string.cpp:621–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619 }
620
621 vec4f SimNode_StringBuilder::eval ( Context & context ) {
622 DAS_PROFILE_NODE
623 vec4f * argValues = (vec4f *)(alloca(nArguments * sizeof(vec4f)));
624 evalArgs(context, argValues);
625 StringBuilderWriter writer;
626 DebugDataWalker<StringBuilderWriter> walker(writer, PrintFlags::string_builder);
627 for ( int i=0, is=nArguments; i!=is; ++i ) {
628 walker.walk(argValues[i], types[i]);
629 }
630 uint64_t length = writer.tellp();
631 if ( length ) {
632 auto pStr = context.allocateString(writer.c_str(), uint32_t(length), &debugInfo, isTempString);
633 if ( isTempString ) context.freeTempString(pStr, &debugInfo);
634 return cast<char *>::from(pStr);
635 } else {
636 return v_zero();
637 }
638 }
639
640 // string iteration
641

Callers

nothing calls this directly

Calls 7

evalArgsFunction · 0.85
toFunction · 0.85
tellpMethod · 0.80
allocateStringMethod · 0.80
v_zeroFunction · 0.50
walkMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected