MCPcopy Create free account
hub / github.com/Chemiculs/qengine / copySectionData

Method copySectionData

src/qengine/extern/asmjit/core/codeholder.cpp:1066–1084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1064}
1065
1066Error CodeHolder::copySectionData(void* dst, size_t dstSize, uint32_t sectionId, CopySectionFlags copyFlags) noexcept {
1067 if (ASMJIT_UNLIKELY(!isSectionValid(sectionId)))
1068 return DebugUtils::errored(kErrorInvalidSection);
1069
1070 Section* section = sectionById(sectionId);
1071 size_t bufferSize = section->bufferSize();
1072
1073 if (ASMJIT_UNLIKELY(dstSize < bufferSize))
1074 return DebugUtils::errored(kErrorInvalidArgument);
1075
1076 memcpy(dst, section->data(), bufferSize);
1077
1078 if (bufferSize < dstSize && Support::test(copyFlags, CopySectionFlags::kPadSectionBuffer)) {
1079 size_t paddingSize = dstSize - bufferSize;
1080 memset(static_cast<uint8_t*>(dst) + bufferSize, 0, paddingSize);
1081 }
1082
1083 return kErrorOk;
1084}
1085
1086Error CodeHolder::copyFlattenedData(void* dst, size_t dstSize, CopySectionFlags copyFlags) noexcept {
1087 size_t end = 0;

Callers

nothing calls this directly

Calls 4

erroredFunction · 0.85
testFunction · 0.85
bufferSizeMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected