From d48f7ec7b4cc726119947e94ea6643b1d53ad5c8 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 1 Nov 2014 04:33:36 -0200 Subject: [PATCH] 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. --- src/core/hle/hle.cpp | 2 +- src/core/hle/hle.h | 2 +- src/core/hle/service/service.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index b03894ad7..50b7ad81b 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp @@ -35,7 +35,7 @@ void CallSVC(u32 opcode) { if (info->func) { info->func(); } else { - ERROR_LOG(HLE, "unimplemented SVC function %s(..)", info->name.c_str()); + ERROR_LOG(HLE, "unimplemented SVC function %s(..)", info->name); } } diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h index bf4d84575..98ea68c2e 100644 --- a/src/core/hle/hle.h +++ b/src/core/hle/hle.h @@ -19,7 +19,7 @@ typedef void (*Func)(); struct FunctionDef { u32 id; Func func; - std::string name; + const char* name; }; struct ModuleDef { diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 2f5a866c9..6e2f79dcf 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -50,7 +50,7 @@ public: struct FunctionInfo { u32 id; Function func; - std::string name; + const char* name; }; /** @@ -95,7 +95,7 @@ public: } if (itr->second.func == nullptr) { 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 u32* cmd_buff = Service::GetCommandBuffer();