fix order of static initialization: add comment

This commit is contained in:
oltolm 2023-02-17 01:29:24 +01:00 committed by Ivan
parent b5b8f7c35a
commit bbd308a908
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,8 @@ extern void sys_initialize_tls(ppu_thread&, u64, u32, u32, u32);
std::unordered_map<std::string, ppu_static_module*>& ppu_module_manager::get()
{
// In C++ the order of static initialization is undefined if it happens in
// separate compilation units, therefore we have to initialize the map on first use.
static std::unordered_map<std::string, ppu_static_module*> s_module_map;
return s_module_map;
}