MCPcopy Create free account
hub / github.com/Snapchat/Valdi / createArena

Method createArena

valdi/src/valdi/runtime/JavaScript/Modules/ProtobufModule.cpp:855–865  ·  view source on GitHub ↗

NOLINTNEXTLINE(readability-convert-member-functions-to-static)

Source from the content-addressed store, hash-verified

853
854// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
855JSValueRef ProtobufModule::createArena(JSFunctionNativeCallContext& callContext) {
856 auto eagerDecoding = callContext.getParameterAsBool(0);
857 CHECK_CALL_CONTEXT(callContext);
858
859 auto includeAllFieldsDuringEncoding = callContext.getParameterAsBool(1);
860 CHECK_CALL_CONTEXT(callContext);
861
862 auto arena = Valdi::makeShared<ProtobufArena>(eagerDecoding, includeAllFieldsDuringEncoding);
863
864 return makeWrappedObject(callContext.getContext(), arena, callContext.getExceptionTracker(), true);
865}
866
867// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
868JSValueRef ProtobufModule::getFieldsForMessageDescriptor(JSFunctionNativeCallContext& callContext) {

Callers

nothing calls this directly

Calls 3

makeWrappedObjectFunction · 0.85
getParameterAsBoolMethod · 0.45
getContextMethod · 0.45

Tested by

no test coverage detected