Commit Graph

773 Commits

Author SHA1 Message Date
Nicholas Nethercote
c14afde851 Bug 1131308 (part 0) - Fix minor problems with RemovingIterator. r=froydnj.
- Its move constructor was moving |aOther.mTable| instead of |aOther|. This
  meant that |aOther| wasn't being zeroed out appropriately.

- test_pldhash_RemovingIterator() was testing Iterator's move constructor
  instead of RemovingIterator's move constructor, due to a copy/paste
  mistake.
2015-07-05 17:49:44 -07:00
Ryan VanderMeulen
ef4314a212 Backed out changeset 37bee149c935 (bug 968520) for checktest failures. 2015-06-30 15:47:18 -04:00
Birunthan Mohanathas
97d4c2d5ec Bug 968520 - Add nsTArray::Assign. r=froydnj 2015-06-30 11:16:03 -07:00
Nicholas Nethercote
ff52c090ad Bug 1176163 - Remove remaining uses of PL_DHashTableEnumerate() from xpcom/. r=froydnj. 2015-06-18 18:09:37 -07:00
Ryan VanderMeulen
db3fcf8fe5 Bug 704368 - Re-enable test_nsIProcess_stress.js on Linux64 debug. 2015-06-18 11:28:51 -04:00
Nicholas Nethercote
a2d83b8f85 Bug 1173600 (part 3) - Add PLDHashTable::RemovingIterator. r=froydnj. 2015-06-10 17:04:07 -07:00
Nicholas Nethercote
b945b71cfa Bug 1174625 - Overhaul PLDHashTable's iterator. r=froydnj.
This change splits PLDHashTable::Iterator::NextEntry() into two separate
functions, which allow you to get the current element and advance the iterator
separately, which means you can use a for-loop to iterate instead of a
while-loop.

As part of this change, the internals of PLDHashTable::Iterator were
significantly changed and simplified (and modelled after js::HashTable's
equivalent code). It's no longer duplicating code from PL_DHashTableEnumerator.
The chaos mode code was a casualty of this, but given how unreliable that code
has proven to be (see bug 1173212, bug 1174046) this is for the best. (We can
reimplement chaos mode once PLDHashTable::Iterator is back on more solid
footing again, if we think it's important.)

All these changes will make it much easier to add an alternative Iterator that
removes elements, which was turning out to be difficult with the prior code.

In order to make the for-loop header usually fit on a single line, I
deliberately renamed a bunch of things to have shorter names.

In summary, you used to write this:

  PLDHashTable::Iterator iter(&table);
  while (iter.HasMoreEntries()) {
    auto entry = static_cast<FooEntry*>(iter.NextEntry());
    // ... do stuff with |entry| ...
  }
  // iter's scope extends beyond here

and now you write this:

  for (auto iter = table.Iter(); !iter.Done(); iter.Next()) {
    auto entry = static_cast<FooEntry*>(iter.Get());
    // ... do stuff with |entry| ...
  }
  // iter's scope doesn't reach here
2015-06-11 21:19:53 -07:00
Birunthan Mohanathas
3959b83c21 Bug 968520 - Add mozilla::fallible to FallibleArray calls in tests. r=froydnj 2015-06-08 13:39:49 -07:00
Nikhil Marathe
080cf2090c Bug 1166504 - Make nsMultiplexInputStream cloneable. r=bkelly,froydnj 2015-06-02 16:12:57 -07:00
Nicholas Nethercote
57d9ca6f4a Bug 1170416 (part 5) - Remove PLDHashTable::IsInitialized(). r=froydnj.
|mOps| is always non-null now, and there's no longer any distinction between
and uninitialized and initialized table. Yay.
2015-05-20 21:23:55 -07:00
Nicholas Nethercote
662f90fecb Bug 1170416 (part 3) - Remove the PLDHashTable2 typedef. r=froydnj. 2015-05-19 16:46:17 -07:00
Nicholas Nethercote
97f24061f9 Bug 1168007 (part 11) - Use PLDHashTable2 exclusively in TestPLDHash. r=froydnj. 2015-05-18 21:58:33 -07:00
Wes Kocher
6f22942c7a Backed out changeset 47a103414177 (bug 1166504) for mochitest-e10s-4 permafail CLOSED TREE 2015-06-01 17:59:17 -07:00
Nikhil Marathe
183af7f394 Bug 1166504 - Make nsMultiplexInputStream cloneable. r=bkelly,froydnj 2015-05-19 14:28:32 -07:00
Nicholas Nethercote
f7e35f3076 Bug 1168007 (part 1) - Add PLDHashTable::{Clear,ClearAndPrepareForLength}(). r=froydnj. 2015-05-18 19:16:06 -07:00
Nicholas Nethercote
5717606138 Bug 1165770 - Add PLDHashTable2. r=froydnj.
This is a temporary sub-class of PLDHashTable that will allow PLDHashTable to
be incrementally transitioned from manual initialization/finalization (via
explicit Init()/Fini() calls) to automatic initialization/finalization (via an
initializing constructor and a destructor). Once all PLDHashTable instances are
converted to PLDHashTable2, it can be folded back into PLDHashTable and the "2"
suffix can be dropped.
2015-05-18 00:52:01 -07:00
Nicholas Nethercote
972275ed2b Back out all four patches from bug 1161377. r=me.
Due to Android startup regressions (bug 1163066) and plugin crashes (bug
1165155).
2015-05-14 21:48:43 -07:00
Brian O'Keefe
f21be4ff50 Bug 924187 - Deal with interfaces.manifest from the backend. r=mshal 2015-02-13 08:11:57 -05:00
Nicholas Nethercote
058f304862 Bug 1161377 (part 3, attempt 2) - Convert some easy PL_DHashTable{Init,Finish} cases. r=froydnj. 2015-05-12 17:33:26 -07:00
Mike Hommey
23fb4c1447 Bug 1043692 - Add a DIST_INSTALL variable to moz.build, and replace NO_DIST_INSTALL with it. r=gps 2015-05-12 07:55:21 +09:00
Nicholas Nethercote
972e6dd284 Backout c375efe78e07 (bug 1161377 part 3) for (probably) increasing the static constructor count and regressing Fennec start-up time. r=me. 2015-05-10 22:16:18 -07:00
JW Wang
92783ac3a1 Bug 1161405. Part 2 - test case for parallelism of the thread pool. r=nfroyd. 2015-05-09 07:32:27 +08:00
Nicholas Nethercote
2ddb2e8069 Bug 1161377 (part 3) - Convert some easy PL_DHashTable{Init,Finish} cases. r=froydnj.
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.
2015-05-04 22:59:24 -07:00
Nicholas Nethercote
7b2a571fc7 Bug 1161377 (part 2) - Remove PL_NewDHashTable() and PL_DHashTableDestroy(). r=froydnj.
They're not needed now that there is an initializing constructor and a
destructor.
2015-05-04 22:59:24 -07:00
Nicholas Nethercote
a58752105d Bug 1160436 - Fix PLDHashTable::operator=. r=froydnj.
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.
2015-05-03 17:04:07 -07:00
Ehsan Akhgari
2c4f532160 Bug 1161240 - Make sure that NS_CloneInputStream correctly deals with null input; r=froydnj 2015-05-05 09:56:47 -04:00
Benjamin Smedberg
758e6c3dc9 Bug 1159737 Stop supporting binary XPCOM components except built into the application. r=froydnj sr=bz Some xpcshell tests of binary functionality need to register binary components. Expose a function "registerAppManifest" in the xpcshell environment to make this available to tests without exposing it to addons. r=bholley 2015-05-01 10:23:44 -04:00
Mike Hommey
b848e4bfcf Bug 1134923 - Remove NS_Alloc/NS_Realloc/NS_Free. r=nfroyd
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.
2015-05-01 09:40:30 +09:00
Nicholas Nethercote
e8d6ee36fa Bug 1159972 - Remove the fallible version of PL_DHashTableInit(). r=froydnj.
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.
2015-04-29 16:38:29 -07:00
Nick Fitzgerald
b1440514e6 Bug 1158257 - Gecko should always provide SpiderMonkey with a debuggerMallocSizeOf; r=mccr8 2015-04-27 10:58:24 -07:00
Botond Ballo
00450f64ac Bug 1156538 - Make nsTArray's move constructor implicit. r=froydnj 2015-04-20 18:42:56 -04:00
Denis Volk
cd6346cce0 Bug 1095098 - move do_QueryObject templates into their own header; r=froydnj 2015-04-15 12:47:03 -04:00
Ehsan Akhgari
6e3297ea9e Fix a missing check in TestStrings.cpp, no bug 2015-04-18 20:51:01 -04:00
Ehsan Akhgari
1730a0b7e5 Back out bug 1149174 since it turns out that the nsTArray range iterators are not stable after all 2015-04-16 18:18:22 -04:00
Andrew McCreight
2881daa7dd Bug 1151541, part 3 - Fix leading tabs in xpcom/. r=froydnj 2015-04-09 10:25:05 -07:00
Andrew McCreight
e2c2eeb647 Bug 1151541, part 2 - Fix mode lines in xpcom/. r=froydnj 2015-04-09 10:25:05 -07:00
Mike Hommey
ee117642af Bug 1134920 - Use moz_xmalloc/moz_xrealloc/free instead of nsMemory::Alloc/Realloc/Free. r=nfroyd 2015-04-01 13:51:45 +09:00
Ehsan Akhgari
f1c2587827 Bug 1149174 - Add a test to ensure that XPCOM nsTArray range iterators are stable; r=froydnj 2015-03-31 16:29:58 -04:00
Andrea Marchesini
94545cbb2e Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00
Ehsan Akhgari
5cccea6f0f Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Geoff Brown
cd69b10089 Bug 1140148 - Update xpcshell test manifests for Android 4.3 emulator; r=dminor 2015-03-19 11:00:58 -06:00
Ben Kelly
1b9774edd8 Bug 1133939 P2 Add tests validating nsPipeOutputStream AsyncWait behavior. r=froydnj 2015-02-21 09:51:17 -05:00
Nicholas Nethercote
b010bbd9ab Bug 1142277 - Fix leak in failure path in TestPLDHash. r=erahm. 2015-03-11 15:39:58 -07:00
Ehsan Akhgari
756095d1ec Bug 1140762 - Move TestThreads.cpp to gtest and enable it; r=froydnj 2015-03-09 11:10:32 -04:00
Ehsan Akhgari
84c37b8c6e Bug 1140760 - Move TestXPIDLString.cpp to gtest and enable it; r=froydnj 2015-03-09 11:10:01 -04:00
Nicholas Nethercote
04609a74fd Bug 1050035 (part 1, attempt 2) - Lazily allocate PLDHashTable::mEntryStore. r=froydnj.
This makes zero-element hash tables, which are common, smaller, and also avoids
unnecessary malloc/free pairs.

I did some measurements during some basic browsing of a few sites. I found that
35% of all live tables were empty with a few tabs open. And cumulatively, for
the whole session, 45% of tables never had an element added to them.
2015-02-01 14:56:33 -08:00
Ehsan Akhgari
18eb496f5f Backed out 2 changesets (bug 1133939) because of bug 1136453
Backed out changeset 212080d51fb7 (bug 1133939)
Backed out changeset 27de4b553912 (bug 1133939)
2015-02-25 13:26:41 -05:00
Ben Kelly
d50dc1f096 Bug 1133939 P2 Add tests validating nsPipeOutputStream AsyncWait behavior. r=froydnj 2015-02-21 09:51:17 -05:00
Ryan VanderMeulen
2397a84c53 Backed out changesets 4c2b179b71ae and c96050cdedd5 (bug 1133939) for asserts. 2015-02-20 20:00:19 -05:00
Ben Kelly
1e584710ca Bug 1133939 P2 Add tests validating nsPipeOutputStream AsyncWait behavior. r=froydnj 2015-02-20 18:16:04 -05:00