Closed Bug 1594268 Opened 6 years ago Closed 5 years ago

Revisit profiler_add_marker_for_thread to avoid payload allocation if possible

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Revisit profiler_add_marker_for_thread to avoid payload allocation if possible.

I was working nearby in bug 1464506, I had a quick look at it and I believe it should be as simple as changing the function parameter from UniquePtr<ProfilerMarkerPayload> to const ProfilerMarkerPayload&, and update callers of course.
I'll tackle it now.

Assignee: nobody → gsquelart
Blocks: 1464506

Instead of accepting a UniquePtr<ProfilerMarkerPayload>, profiler_add_marker_for_thread now takes it by const ProfilerMarkerPayload&.
All callers can now create the payload on the stack, or as a temporary object. This saves a memory alloc+free for each call.

Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4832801ac3df profiler_add_marker_for_thread takes payload by const& - r=canaltinova
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: