diff options
Diffstat (limited to 'src/zencore/memory/memory.cpp')
| -rw-r--r-- | src/zencore/memory/memory.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/zencore/memory/memory.cpp b/src/zencore/memory/memory.cpp index f236796ad..ae1b9abce 100644 --- a/src/zencore/memory/memory.cpp +++ b/src/zencore/memory/memory.cpp @@ -87,14 +87,19 @@ InitGMalloc() } }; - constexpr std::string_view MallocOption = "--malloc="sv; + constexpr std::string_view MallocOption = "--malloc"sv; std::function<void(const std::string_view&)> ProcessArg = [&](const std::string_view& Arg) { if (Arg.starts_with(MallocOption)) { - const std::string_view OptionArgs = Arg.substr(MallocOption.size()); + std::string_view::value_type DelimChar = Arg[MallocOption.length()]; - IterateCommaSeparatedValue(OptionArgs, ProcessMallocArg); + if (DelimChar == ' ' || DelimChar == '=') + { + const std::string_view OptionArgs = Arg.substr(MallocOption.size() + 1); + + IterateCommaSeparatedValue(OptionArgs, ProcessMallocArg); + } } }; |