Skip to content

Commit

Permalink
remove the dependency on haxe's stackframe context, use tracyZones ve…
Browse files Browse the repository at this point in the history
…ctor instead
  • Loading branch information
dazKind committed Sep 8, 2024
1 parent b722724 commit b714dd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/hx/TelemetryTracy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ void __hxt_gc_after_mark(int byteMarkId, int endianByteMarkId) { }

void __hxt_gc_start()
{
//gcZone = ___tracy_emit_zone_begin(&gcSourceLocation, true);
gcZone = ___tracy_emit_zone_begin(&gcSourceLocation, true);
}

void __hxt_gc_end()
{
//___tracy_emit_zone_end(gcZone);
___tracy_emit_zone_end(gcZone);
}

hx::Telemetry* hx::tlmCreate(StackContext* stack)
Expand Down Expand Up @@ -96,8 +96,8 @@ void hx::tlmSampleEnter(hx::Telemetry* telemetry, hx::StackFrame* frame)
strlen(frame->position->fullName),
0);

// Hxcpp callstack depth starts at 0, but tracy expects it to start at 1.
auto depth = frame->ctx->getDepth() + 1;
// Determine depth from tracyZones vector: +1 since we are about to add one
auto depth = telemetry->tracyZones.size() + 1;

telemetry->tracyZones.push_back(___tracy_emit_zone_begin_alloc_callstack(srcloc, depth, true));
}
Expand Down
1 change: 0 additions & 1 deletion src/hx/cppia/Cppia.h
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,6 @@ class CppiaClassInfo
ctx = inCtx;
frame = (hx::StackFrame *)ctx->stackAlloc(sizeof(hx::StackFrame));
frame->position = inPosition;
frame->ctx = ctx;
#ifdef HXCPP_DEBUGGER
frame->variables = 0;
frame->catchables = 0;
Expand Down

0 comments on commit b714dd3

Please sign in to comment.