Hi,

I changed PLDHashTable a little while back so that the allocation of
entry storage happens when the first element is added, rather than
when the table is initialized. This means that initialization is now
infallible and cheap, which means there is no need to distinguish
between an uninitialized and an initialized state/

While doing that I took the opportunity to convert the C-style
initialization/finalization (via explicit Init and Finish functions)
to C++-style (via a constructor and destructor).

I just landed on mozilla-inbound the patches from
https://bugzilla.mozilla.org/show_bug.cgi?id=1170416, which make the
following API changes.

- PL_DHashTableInit() is gone. Use the new initializing constructor
instead; it has the same last three arguments.

- PL_DHashTableFinish() is gone. Use the destructor instead, which
doesn't require you to do anything.

- People sometimes used PL_DHashTableFinish() immediately followed by
PL_DHashTableInit() to clear out a table. Use PLDHashTable::Clear() or
PLDHashTable::ClearAndPrepareForLength() instead.

- PL_NewDHashTable is gone. Use operator new instead.

- PL_DHashTableDestroy() is gone. Use operator delete instead.

There is a patch updating comm-central at
https://bugzilla.mozilla.org/show_bug.cgi?id=1163331.

Some of you may have noticed a class named PLDHashTable2 in the
codebase. This was a temporary class there to help the above
transition, and it has now been removed.

Nick
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to