Skip to content

Commit 4696dd6

Browse files
committed
Capture task trace information with string views
1 parent 05f1b97 commit 4696dd6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

fly/task/task_types.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <cstdint>
44
#include <functional>
5+
#include <string_view>
56

67
namespace fly {
78

@@ -12,8 +13,8 @@ class TaskRunner;
1213
*/
1314
struct TaskLocation
1415
{
15-
const char *m_file {nullptr};
16-
const char *m_function {nullptr};
16+
std::string_view m_file;
17+
std::string_view m_function;
1718
std::uint32_t m_line {0};
1819
};
1920

test/util/waitable_task_runner.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace fly::test {
77
//==================================================================================================
88
void WaitableTaskRunner::task_complete(fly::TaskLocation &&location)
99
{
10-
m_completed_tasks.push(location.m_file);
10+
m_completed_tasks.push(std::string(location.m_file.data(), location.m_file.size()));
1111
}
1212

1313
//==================================================================================================

0 commit comments

Comments
 (0)