Update DynamicallyLinkedFunctionPtr to take advantage of new MOZ_STATIC_LOCAL_CLASS annotation
Categories
(Core :: mozglue, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: bugzilla, Assigned: bugzilla)
Details
Attachments
(2 files)
Most uses of DynamicallyLinkedFunctionPtr
are as static locals, which means that we end up generating a bunch of unnecessary FreeLibrary
calls when these objects are destroyed at shutdown.
Now that we have MOZ_STATIC_LOCAL_CLASS
, we can create a variant for static locals that has a trivial destructor, thus eliminating all that FreeLibrary
goop.
Assignee | ||
Comment 1•5 years ago
|
||
This patch does two things:
-
We refactor the resolution of function pointer and return type so that we
may support additional calling conventions besides just __stdcall; -
We refactor DynamicallyLinkedFunctionPtr into a base class, and create
StaticDynamicallyLinkedFunctionPtr to specifically handle the static local
use case.
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D40885
Pushed by aklotz@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f1c97ef1f9cb Part 1 - Refactor DynamicallyLinkedFunctionPtr into static local and normal variants; r=mhowell https://hg.mozilla.org/integration/autoland/rev/20cdaeefd4e1 Part 2 - Change over all existing static local uses of DynamicallyLinkedFunctionPtr to use StaticDynamicallyLinkedFunctionPtr instead; r=mhowell
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f1c97ef1f9cb
https://hg.mozilla.org/mozilla-central/rev/20cdaeefd4e1
Description
•