From fb6426127354415505dbedacd63b3a16116dac2f Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Fri, 22 Aug 2025 18:16:09 +0200 Subject: clean up trace options parsing (#473) * clean up trace command line options explicitly shut down worker pools * some additional startup trace scopes --- src/zencore/memory/memory.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/zencore/memory/memory.cpp') 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 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); + } } }; -- cgit v1.2.3