Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 403337e

Browse files
Do not pass short-lived buffers as labels to Dart_TimelineEvent (#8166)
Dart no longer makes a copy of the label string when recording events. See #8152
1 parent e514f0b commit 403337e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fml/trace_event.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id);
205205

206206
class ScopedInstantEnd {
207207
public:
208-
ScopedInstantEnd(std::string str) : label_(std::move(str)) {}
208+
ScopedInstantEnd(const char* str) : label_(str) {}
209209

210-
~ScopedInstantEnd() { TraceEventEnd(label_.c_str()); }
210+
~ScopedInstantEnd() { TraceEventEnd(label_); }
211211

212212
private:
213-
const std::string label_;
213+
const char* label_;
214214

215215
FML_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd);
216216
};

0 commit comments

Comments
 (0)