diff options
| author | Stefan Boberg <[email protected]> | 2024-11-19 09:59:04 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-11-19 09:59:04 +0100 |
| commit | e335ca10a6c6a1e37b155e2155f5c5908c0272ae (patch) | |
| tree | 78b32384df0e58b22052dcfa7990c16921c6b650 /src/zencore/thread.cpp | |
| parent | 5.5.12 (diff) | |
| download | zen-e335ca10a6c6a1e37b155e2155f5c5908c0272ae.tar.xz zen-e335ca10a6c6a1e37b155e2155f5c5908c0272ae.zip | |
memory/string support cleanup and additions (#220)
* removed unused memory classes
* added align.h alignment helpers used in upcoming changes
* added char16_t StringLength
* avoid memory alloc in SetCurrentThreadName
* added command line parsing helpers to zencore/commandline.h
* removed IoBuffer direct VirtualAlloc path
Diffstat (limited to 'src/zencore/thread.cpp')
| -rw-r--r-- | src/zencore/thread.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/zencore/thread.cpp b/src/zencore/thread.cpp index ca3759fbf..78afe924b 100644 --- a/src/zencore/thread.cpp +++ b/src/zencore/thread.cpp @@ -80,8 +80,10 @@ SetNameInternal(DWORD thread_id, const char* name) void SetCurrentThreadName([[maybe_unused]] std::string_view ThreadName) { - std::string ThreadNameZ{ThreadName}; - const int ThreadId = GetCurrentThreadId(); + StringBuilder<256> ThreadNameZ; + ThreadNameZ << ThreadName; + const int ThreadId = GetCurrentThreadId(); + #if ZEN_WITH_TRACE trace::ThreadRegister(ThreadNameZ.c_str(), /* system id */ ThreadId, /* sort id */ 0); #endif // ZEN_WITH_TRACE |