diff --git a/source/main.cpp b/source/main.cpp index fa0f108..f155d1c 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -30,7 +30,7 @@ plugin_information_t *gPluginInformation __attribute__((section(".data"))) = NUL int test(); -std::vector loadPlugins(const std::vector &pluginList); +std::vector loadPlugins(const std::vector &pluginList, MEMHeapHandle heapHandle); #define gModuleData ((module_information_t *) (0x00880000)) @@ -77,7 +77,7 @@ int test() { std::vector pluginList = PluginDataFactory::loadDir("fs:/vol/external01/wiiu/plugins/", pluginDataHeap); DEBUG_FUNCTION_LINE("Loaded %d plugin data", pluginList.size()); - std::vector plugins = loadPlugins(pluginList); + std::vector plugins = loadPlugins(pluginList, pluginDataHeap); for (auto &pluginContainer : plugins) { for (const auto &kv : pluginContainer.getPluginInformation().getSectionInfoList()) { @@ -110,7 +110,7 @@ int test() { return 0; } -std::vector loadPlugins(const std::vector &pluginList) { +std::vector loadPlugins(const std::vector &pluginList, MEMHeapHandle heapHandle) { std::vector plugins; for (auto &pluginData : pluginList) { @@ -127,7 +127,7 @@ std::vector loadPlugins(const std::vector &pluginLi } for (auto &pluginContainer : plugins) { uint32_t trampolineId = pluginContainer.getPluginInformation().getTrampolinId(); - std::optional info = PluginInformationFactory::load(pluginContainer.getPluginData(), pluginDataHeap, gPluginInformation->trampolines, DYN_LINK_TRAMPOLIN_LIST_LENGTH, trampolineId); + std::optional info = PluginInformationFactory::load(pluginContainer.getPluginData(), heapHandle, gPluginInformation->trampolines, DYN_LINK_TRAMPOLIN_LIST_LENGTH, trampolineId); if (!info) { DEBUG_FUNCTION_LINE("Failed to load Plugin %s", pluginContainer.getMetaInformation().getName().c_str()); diff --git a/source/plugin/PluginData.cpp b/source/plugin/PluginData.cpp index 07f0668..59d39e1 100644 --- a/source/plugin/PluginData.cpp +++ b/source/plugin/PluginData.cpp @@ -50,6 +50,7 @@ PluginData::PluginData(std::vector input, MEMHeapHandle heapHandle, eMe default: case eMemTypeExpHeap: data_copy = MEMAllocFromExpHeapEx(heapHandle, length, 4); + DEBUG_FUNCTION_LINE("Allocated %d kb from ExpHeap", length / 1024); if (data_copy == NULL) { DEBUG_FUNCTION_LINE("Failed to allocate space on exp heap"); } else {