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

Method allocationFunction

libsolidity/codegen/YulUtilFunctions.cpp:3224–3239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3222}
3223
3224std::string YulUtilFunctions::allocationFunction()
3225{
3226 std::string functionName = "allocate_memory";
3227 return m_functionCollector.createFunction(functionName, [&]() {
3228 return Whiskers(R"(
3229 function <functionName>(size) -> memPtr {
3230 memPtr := <allocateUnbounded>()
3231 <finalizeAllocation>(memPtr, size)
3232 }
3233 )")
3234 ("functionName", functionName)
3235 ("allocateUnbounded", allocateUnboundedFunction())
3236 ("finalizeAllocation", finalizeAllocationFunction())
3237 .render();
3238 });
3239}
3240
3241std::string YulUtilFunctions::allocateUnboundedFunction()
3242{

Calls 3

WhiskersClass · 0.85
renderMethod · 0.80
createFunctionMethod · 0.45

Tested by

no test coverage detected