mirror of
https://github.com/wiiu-env/WUMSLoader.git
synced 2026-03-21 17:44:16 -05:00
Fix using memory mapping module allocator if possible
This commit is contained in:
parent
e9e5f34459
commit
f00d4a9dc0
|
|
@ -277,7 +277,7 @@ std::vector<ModuleContainer> ModuleManagement::loadAndLinkModules(const std::str
|
|||
if (auto linkInfo = ModuleLinkInformationFactory::loadAndLink(std::span(file.data(), file.size()), defaultAllocator, error)) {
|
||||
moduleContainers.emplace_back(std::move(metaInfo), std::move(*linkInfo));
|
||||
} else {
|
||||
auto errMsg = string_format("Failed to load/link module %s. %s", metaInfo.getExportName().c_str(), ModuleLinkErrorsToString(error));
|
||||
auto errMsg = string_format("Failed to load/link module %s. %s", metaInfo.getExportName().c_str(), ModuleLinkErrorsToString(error).data());
|
||||
DEBUG_FUNCTION_LINE_ERR("%s", errMsg.c_str());
|
||||
OSFatal(errMsg.c_str());
|
||||
}
|
||||
|
|
@ -308,10 +308,10 @@ std::vector<ModuleContainer> ModuleManagement::loadAndLinkModules(const std::str
|
|||
|
||||
for (auto &[metaInfo, file] : regularModuleMetaInfoWithLoadedFiles) {
|
||||
ModuleLinkErrors error = ModuleLinkErrors::MODULE_LINK_ERROR_NONE;
|
||||
if (auto linkInfo = ModuleLinkInformationFactory::loadAndLink(std::span(file.data(), file.size()), defaultAllocator, error)) {
|
||||
if (auto linkInfo = ModuleLinkInformationFactory::loadAndLink(std::span(file.data(), file.size()), *mappedAllocatorOpt, error)) {
|
||||
moduleContainers.emplace_back(std::move(metaInfo), std::move(*linkInfo));
|
||||
} else {
|
||||
auto errMsg = string_format("Failed to load/link module %s. %s", metaInfo.getExportName().c_str(), ModuleLinkErrorsToString(error));
|
||||
auto errMsg = string_format("Failed to load/link module %s. %s", metaInfo.getExportName().c_str(), ModuleLinkErrorsToString(error).data());
|
||||
DEBUG_FUNCTION_LINE_ERR("%s", errMsg.c_str());
|
||||
OSFatal(errMsg.c_str());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user