gecko/netwerk/base
Nicholas Nethercote a5c8dbfaf4 Bug 1123151 (part 1) - Set PLDHashTable::ops consistently. r=froydnj.
Currently the setting of PLDHashTable::ops is very haphazard.

- PLDHashTable has no constructor, so it's not auto-nulled, so lots of places
  null it themselves.

- In the fallible PLDHashTable::Init() function, if the entry storage
  allocation fails we'll be left with a table that has |ops| set -- indicating
  it's been initialized -- but has null entry storage. I'm not certain this can
  cause problems but it feels unsafe, and some (but not all) callers of Init()
  null it on failure.

- PLDHashTable does not null |ops| in Finish(), so some (but not all) callers
  do this themselves.

This patch makes things simpler.

- It adds a constructor that zeroes |ops|.

- It modifies Init() so that it only sets |ops| once success is ensured.

- It zeroes |ops| in Finish().

- Finally, it removes all the now-unnecessary |ops| nulling done by the users
  of PLDHashTable.

--HG--
extra : rebase_source : bb34979c218d152562a2f9c7e5215256c111cc5b
2015-01-19 16:01:24 -08:00
..
public Bug 1009122 - use cache2 as storage for predictor data. r=honzab 2015-01-14 13:59:04 -08:00
src Bug 1123151 (part 1) - Set PLDHashTable::ops consistently. r=froydnj. 2015-01-19 16:01:24 -08:00
moz.build