MCPcopy Create free account
hub / github.com/argotorg/solidity / allocateMemoryStructFunction

Method allocateMemoryStructFunction

libsolidity/codegen/YulUtilFunctions.cpp:3366–3381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3364}
3365
3366std::string YulUtilFunctions::allocateMemoryStructFunction(StructType const& _type)
3367{
3368 std::string functionName = "allocate_memory_struct_" + _type.identifier();
3369 return m_functionCollector.createFunction(functionName, [&]() {
3370 Whiskers templ(R"(
3371 function <functionName>() -> memPtr {
3372 memPtr := <alloc>(<allocSize>)
3373 }
3374 )");
3375 templ("functionName", functionName);
3376 templ("alloc", allocationFunction());
3377 templ("allocSize", _type.memoryDataSize().str());
3378
3379 return templ.render();
3380 });
3381}
3382
3383std::string YulUtilFunctions::allocateAndInitializeMemoryStructFunction(StructType const& _type)
3384{

Callers 1

endVisitMethod · 0.80

Calls 5

identifierMethod · 0.80
strMethod · 0.80
renderMethod · 0.80
createFunctionMethod · 0.45
memoryDataSizeMethod · 0.45

Tested by

no test coverage detected