Re: Hash table iterators, and a call for help

2016-02-03 Thread Nicholas Nethercote
On Fri, Jul 24, 2015 at 11:26 AM, Nicholas Nethercote wrote: > > Given that, I went ahead and filed bugs to get rid of the ~200 > nsBaseHashtable::EnumerateRead() calls and ~140 > nsBaseHashtable::Enumerate() calls. They are all marked as blocking > https://bugzilla.mozilla.org/show_bug.cgi?id=118

Re: Hash table iterators, and a call for help

2015-07-24 Thread Jonas Sicking
On Fri, Jul 24, 2015 at 1:59 AM, Nicholas Nethercote wrote: > On Fri, Jul 24, 2015 at 5:45 PM, Jonas Sicking wrote: >> On Thu, Jul 23, 2015 at 10:16 PM, Nicholas Nethercote >> wrote: >>> I wonder if converting all the uses of PLHashTable into PLDHashTable >>> would instead be a better approach.

Re: Hash table iterators, and a call for help

2015-07-24 Thread Nicholas Nethercote
On Fri, Jul 24, 2015 at 5:45 PM, Jonas Sicking wrote: > On Thu, Jul 23, 2015 at 10:16 PM, Nicholas Nethercote > wrote: >> I wonder if converting all the uses of PLHashTable into PLDHashTable >> would instead be a better approach. > > Yes please! Though IIRC they are have different performance > c

Re: Hash table iterators, and a call for help

2015-07-24 Thread Jonas Sicking
On Thu, Jul 23, 2015 at 10:16 PM, Nicholas Nethercote wrote: > I wonder if converting all the uses of PLHashTable into PLDHashTable > would instead be a better approach. Yes please! Though IIRC they are have different performance characteristics, which might make that challenging in some cases.

Re: Hash table iterators, and a call for help

2015-07-23 Thread Nicholas Nethercote
On Fri, Jul 24, 2015 at 2:06 PM, Philip Chee wrote: > > Does PL_HashTableEnumerateEntries also need to be replaced? And if so > what with? That function operates on PLHashTable, which is part of NSPR. (Don't confuse it with PLDHashTable, which is part of XPCOM, as are its subclasses.) It could b

Re: Hash table iterators, and a call for help

2015-07-23 Thread Philip Chee
On 24/07/2015 09:26, Nicholas Nethercote wrote: > I mentioned this in all the bugs I filed to minimize the likelihood of > mix-ups. I also filed all the EnumerateRead()-replacement bugs > separately from all the Enumerate()-replacement bugs for the same > reason. Please ask me if anything is uncle

Re: Hash table iterators, and a call for help

2015-07-23 Thread Nicholas Nethercote
On Sun, Jul 12, 2015 at 10:36 PM, Nicholas Nethercote wrote: > > Last week I landed patches that remove PL_DHashTableEnumerate() from > the tree (https://bugzilla.mozilla.org/show_bug.cgi?id=1180072). You > should now use PLDHashTable::Iterator if you want to iterate over a > PLDHashTable. The ite

Re: Hash table iterators, and a call for help

2015-07-20 Thread Nicholas Nethercote
On Mon, Jul 20, 2015 at 5:18 PM, Nicholas Nethercote wrote: >> >> Is there a reason the iterator methods are named GetKey(), GetData(), >> etc instead of just Key(), Data(), etc? > > For PLDHashTable and nsTHashtable it's just Get(), and I followed that > for nsBaseHashtable. But I can change it t

Re: Hash table iterators, and a call for help

2015-07-20 Thread Nicholas Nethercote
On Mon, Jul 20, 2015 at 12:37 AM, Kyle Huey wrote: > > Is there a reason the iterator methods are named GetKey(), GetData(), > etc instead of just Key(), Data(), etc? For PLDHashTable and nsTHashtable it's just Get(), and I followed that for nsBaseHashtable. But I can change it to Key(), Data() a

Re: Hash table iterators, and a call for help

2015-07-20 Thread Nathan Froyd
On Mon, Jul 20, 2015 at 3:37 AM, Kyle Huey wrote: > Is there a reason the iterator methods are named GetKey(), GetData(), > etc instead of just Key(), Data(), etc? > Because the XPCOM owner is an idiot and forgot about the Gecko convention. -Nathan __

Re: Hash table iterators, and a call for help

2015-07-20 Thread Kyle Huey
On Mon, Jul 13, 2015 at 1:36 PM, Nicholas Nethercote wrote: > Hi, > > Last week I landed patches that remove PL_DHashTableEnumerate() from > the tree (https://bugzilla.mozilla.org/show_bug.cgi?id=1180072). You > should now use PLDHashTable::Iterator if you want to iterate over a > PLDHashTable. Th

Re: Hash table iterators, and a call for help

2015-07-19 Thread Nicholas Nethercote
On Sun, Jul 19, 2015 at 8:39 PM, Ting-Yu Lin wrote: > It might be worth to mention the PLDHashTable::Iterator in the hashtable > guides. > > https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Guide/Hashtables > https://developer.mozilla.org/en-US/docs/Detailed_XPCOM_hashtable_guide Thank

Re: Hash table iterators, and a call for help

2015-07-19 Thread Ting-Yu Lin
It might be worth to mention the PLDHashTable::Iterator in the hashtable guides. https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Guide/Hashtables https://developer.mozilla.org/en-US/docs/Detailed_XPCOM_hashtable_guide TYLin On Mon, Jul 13, 2015 at 1:36 PM, Nicholas Nethercote wrote:

Re: Hash table iterators, and a call for help

2015-07-13 Thread Nicholas Nethercote
On Mon, Jul 13, 2015 at 11:20 PM, Jeff Muizelaar wrote: > I did not see nsTHashtable and nsBasHashtable define stl style > iterators for use in range-based for loops. Is this intentional? See https://bugzilla.mozilla.org/show_bug.cgi?id=1149833. Nick _

Re: Hash table iterators, and a call for help

2015-07-13 Thread Jeff Muizelaar
I did not see nsTHashtable and nsBasHashtable define stl style iterators for use in range-based for loops. Is this intentional? -Jeff On Mon, Jul 13, 2015 at 1:36 AM, Nicholas Nethercote wrote: > Hi, > > Last week I landed patches that remove PL_DHashTableEnumerate() from > the tree (https://bug

Hash table iterators, and a call for help

2015-07-12 Thread Nicholas Nethercote
Hi, Last week I landed patches that remove PL_DHashTableEnumerate() from the tree (https://bugzilla.mozilla.org/show_bug.cgi?id=1180072). You should now use PLDHashTable::Iterator if you want to iterate over a PLDHashTable. The iterator is *so* much nicer -- there's none of that "bundle up an envi