This changes the way nsMemoryReporterManger handles child processes;
instead of using an observer message and trying to keep a count of child
processes expected to answer, it directly iterates a copy of the list
of content processes and explicitly handles children which exit before
their reports start.
Note that GC/CC logs still run at full concurrency, and that no child
reports start until the parent is finished (see bug 1151597) regardless
of concurrency limit.
This changes the way nsMemoryReporterManger handles child processes;
instead of using an observer message and trying to keep a count of child
processes expected to answer, it directly iterates a copy of the list
of content processes and explicitly handles children which exit before
their reports start.
Note that GC/CC logs still run at full concurrency, and that no child
reports start until the parent is finished (see bug 1151597) regardless
of concurrency limit.
This fixes the following problems with PLDHashTable::operator=:
- It doesn't handle self-assigments.
- It leaks the memory used by the assigned-to table.
- It doesn't leave the assigned-from table in a safely destructable state.
--HG--
extra : rebase_source : 433ac3418c00e3bb6d376982e4c679d27e42a377
This patch converts easy cases, i.e. where the PL_DHashTableInit() call occurs
in a constructor and the PL_DHashTableFinish() call occurs in a destructor.
The destructor is "opt-in" -- there's a flag that makes it a no-op unless the
table was initialized with the initializing constructor. This will allow us to
incrementally convert existing tables from manual to automatic
initialization/finalization. This is important because some of the existing
uses are tricky (impossible?) to convert to the automatic style.
They are kept around for the sake of the standalone glue, which is used
for e.g. webapprt, which doesn't have direct access to jemalloc, and thus
still needs a wrapper to go through the xpcom function list and get to
jemalloc from there.
It's no longer needed now that entry storage isn't allocated there. (The other
possible causes of failures in that function are less interesting and simply
crashing is a reasonable thing to do for them.)
This also makes PL_DNewHashTable() infallible, so I removed some
now-unnecessary checks of its result.
--HG--
extra : rebase_source : 4c6ab0c449bc18e8bace8bf036b5bd78d3a2f1c4
mData will get automatically constructed when DataType is a class or
struct with a default constructor, but a number of uses of
nsBaseHashtable use integer or pointer types as DataType. Explicitly
initialize mData so that it looks as though we're fully initializing the
class in such cases.
Also fixes bug 1005154 -- since there's now a method for "end of report",
we might as well call it from ActorDestroy instead of Recv__delete__.
--HG--
extra : rebase_source : 89f467fbc553a1a3a4d9b144fff747fa3447f21b
Coverty complains that we're using sizeof(mData) here instead of
sizeof(*mData). They're equivalent for all the architectures we care about,
but go ahead and tidy up the syntax to silence the static analyzer.
The current name reads to me like a boolean variable, even though it's
actually a counter. Try to make that property more explicit at its uses
by renaming it to something more evocative of counter-ness.
2015-04-24 16:04:50 -04:00
Chih-Kai (Patrick) Wang ext:(%2C%20Cervantes%20Yu%20%3Ccyu%40mozilla.com%3E)