Back to index

lightning-sunbird  0.9+nobinonly
nsTemplateMatchSet.h File Reference
#include "nsRuleNetwork.h"
#include "nsFixedSizeAllocator.h"
#include "nsTemplateMatch.h"
#include "pldhash.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  nsTemplateMatchSet
class  nsTemplateMatchSet::Element
class  nsTemplateMatchSet::ConstIterator
class  nsTemplateMatchRefSet
 A set of references nsTemplateMatch objects. More...
struct  nsTemplateMatchRefSet::Entry
 Hashtable entry; holds weak reference to a match object. More...
struct  nsTemplateMatchRefSet::InlineMatches
 If the set is currently. More...
union  nsTemplateMatchRefSet::_stor_elements
 The set is implemented as a dual datastructure. More...
class  nsTemplateMatchRefSet::ConstIterator
 An iterator that can be used to enumerate the contents of the set. More...

Class Documentation

struct nsTemplateMatchRefSet::InlineMatches

If the set is currently.

Definition at line 209 of file nsTemplateMatchSet.h.

Collaboration diagram for nsTemplateMatchRefSet::InlineMatches:
Class Members
PRUint32 mCount
nsTemplateMatch * mEntries
union nsTemplateMatchRefSet::_stor_elements

The set is implemented as a dual datastructure.

It is initially a simple array that holds storage for kMaxInlineMatches elements. Once that capacity is exceeded, the storage is re-used for a PLDHashTable header. The hashtable allocates its entries from the normal malloc() heap.

the InlineMatches structure is implemented such that its mCount variable overlaps with the PLDHashTable's `ops' member (which is a pointer to the hashtable's callback table). On a 32-bit architecture, we're safe assuming that the value for `ops' will be larger than kMaxInlineMatches when treated as an unsigned integer. And we'd have to get pretty unlucky on a 64-bit system for us to get screwed, I think.

Instrumentation (define NSTEMPLATEMATCHSET_METER) shows that almost all of the match sets contain fewer than seven elements.

Definition at line 232 of file nsTemplateMatchSet.h.

Collaboration diagram for nsTemplateMatchRefSet::_stor_elements:
Class Members
InlineMatches mInlineMatches
PLDHashTable mTable