Don't use std::string for service entrypoint names

This avoids many unecessary allocations of std::string during startup
and shutdown, as well as reducing memory usage by an insignificant
amount.
This commit is contained in:
Yuri Kunde Schlesner 2014-11-01 04:33:36 -02:00
parent b4d766fbb3
commit d48f7ec7b4
3 changed files with 4 additions and 4 deletions

View file

@ -35,7 +35,7 @@ void CallSVC(u32 opcode) {
if (info->func) { if (info->func) {
info->func(); info->func();
} else { } else {
ERROR_LOG(HLE, "unimplemented SVC function %s(..)", info->name.c_str()); ERROR_LOG(HLE, "unimplemented SVC function %s(..)", info->name);
} }
} }

View file

@ -19,7 +19,7 @@ typedef void (*Func)();
struct FunctionDef { struct FunctionDef {
u32 id; u32 id;
Func func; Func func;
std::string name; const char* name;
}; };
struct ModuleDef { struct ModuleDef {

View file

@ -50,7 +50,7 @@ public:
struct FunctionInfo { struct FunctionInfo {
u32 id; u32 id;
Function func; Function func;
std::string name; const char* name;
}; };
/** /**
@ -95,7 +95,7 @@ public:
} }
if (itr->second.func == nullptr) { if (itr->second.func == nullptr) {
ERROR_LOG(OSHLE, "unimplemented function: port=%s, name=%s", ERROR_LOG(OSHLE, "unimplemented function: port=%s, name=%s",
GetPortName().c_str(), itr->second.name.c_str()); GetPortName().c_str(), itr->second.name);
// TODO(bunnei): Hack - ignore error // TODO(bunnei): Hack - ignore error
u32* cmd_buff = Service::GetCommandBuffer(); u32* cmd_buff = Service::GetCommandBuffer();