tracy: support naming threads

This commit is contained in:
Mitchell Hashimoto
2022-11-07 07:33:36 -08:00
parent 7b94153458
commit 46a9998762

View File

@ -187,6 +187,11 @@ const Impl = struct {
return .{}; return .{};
} }
/// Name the current thread.
pub inline fn setThreadName(comptime name: [:0]const u8) void {
c.___tracy_set_thread_name(name.ptr);
}
inline fn alloc(ptr: [*]u8, len: usize) void { inline fn alloc(ptr: [*]u8, len: usize) void {
if (has_callstack_support) { if (has_callstack_support) {
c.___tracy_emit_memory_alloc_callstack(ptr, len, callstack_depth, 0); c.___tracy_emit_memory_alloc_callstack(ptr, len, callstack_depth, 0);
@ -245,6 +250,10 @@ const Noop = struct {
pub inline fn frame(comptime name: [:0]const u8) Frame(name) { pub inline fn frame(comptime name: [:0]const u8) Frame(name) {
return .{}; return .{};
} }
pub inline fn setThreadName(comptime name: [:0]const u8) void {
_ = name;
}
}; };
test {} test {}