Fix `jemalloc_replace_dynamic()`.
Categories
(Core :: Memory Allocator, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
This is needed for PHC (bug 1523276).
Assignee | ||
Comment 1•5 years ago
|
||
jemalloc_replace_dynamic()
is badly broken. If you install a malloc table
other than the default at startup (e.g. DMD's or PHC's), when you call
jemalloc_replace_dynamic()
it installs a new allocator that wraps the
default allocator, and then when you call jemalloc_replace_dynamic(nullptr)
it switches back to the default allocator.
This commits makes numerous improvements.
-
It removes the "flip-flopping" between malloc tables, which didn't really
work and isn't necessary. -
jemalloc_replace_dynamic()
now switches between the original malloc table
and the new one, rather than the default malloc table and the new one. -
It renames various things, to make the names shorter and clearer.
-
It clearly documents the dangers and limitations of
jemalloc_replace_dynamic()
. -
It removes and inlines
profiler::Init()
, because there was only one call
site. -
It rearranges
install_memory_counter()
so the control flow is simpler.
Comment 3•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•