Bug 34619. Judicious use of fixed size allocators to reduce overhead.

This commit is contained in:
waterson%netscape.com 2000-04-25 01:24:24 +00:00
Родитель a70b3379f0
Коммит 5eb3e883e3
6 изменённых файлов: 900 добавлений и 462 удалений

Просмотреть файл

@ -598,7 +598,7 @@ RootNode::Propogate(const InstantiationSet& aInstantiations, void* aClosure)
}
nsresult
RootNode::Constrain(InstantiationSet& aInstantiations)
RootNode::Constrain(InstantiationSet& aInstantiations, void* aClosure)
{
return NS_OK;
}
@ -676,7 +676,7 @@ JoinNode::Propogate(const InstantiationSet& aInstantiations, void* aClosure)
if (! instantiations.Empty()) {
// propogate consistency checking back up the tree
rv = test->Constrain(instantiations);
rv = test->Constrain(instantiations, aClosure);
if (NS_FAILED(rv)) return rv;
NodeSet::Iterator last = mKids.Last();
@ -753,7 +753,7 @@ JoinNode::Bind(InstantiationSet& aInstantiations, PRBool* aDidBind)
}
nsresult
JoinNode::Constrain(InstantiationSet& aInstantiations)
JoinNode::Constrain(InstantiationSet& aInstantiations, void* aClosure)
{
if (aInstantiations.Empty())
return NS_OK;
@ -782,7 +782,7 @@ JoinNode::Constrain(InstantiationSet& aInstantiations)
last = mLeftParent;
}
rv = first->Constrain(aInstantiations);
rv = first->Constrain(aInstantiations, aClosure);
if (NS_FAILED(rv)) return rv;
if (! didBind) {
@ -792,7 +792,7 @@ JoinNode::Constrain(InstantiationSet& aInstantiations)
NS_ASSERTION(didBind, "uh oh, still no binding");
}
rv = last->Constrain(aInstantiations);
rv = last->Constrain(aInstantiations, aClosure);
if (NS_FAILED(rv)) return rv;
if (! didBind) {
@ -865,7 +865,7 @@ TestNode::Propogate(const InstantiationSet& aInstantiations, void* aClosure)
nsresult rv;
InstantiationSet instantiations = aInstantiations;
rv = FilterInstantiations(instantiations);
rv = FilterInstantiations(instantiations, aClosure);
if (NS_FAILED(rv)) return rv;
if (! instantiations.Empty()) {
@ -879,17 +879,17 @@ TestNode::Propogate(const InstantiationSet& aInstantiations, void* aClosure)
nsresult
TestNode::Constrain(InstantiationSet& aInstantiations)
TestNode::Constrain(InstantiationSet& aInstantiations, void* aClosure)
{
nsresult rv;
rv = FilterInstantiations(aInstantiations);
rv = FilterInstantiations(aInstantiations, aClosure);
if (NS_FAILED(rv)) return rv;
if (! aInstantiations.Empty()) {
// if we still have instantiations, then ride 'em on up to the
// parent to narrow them.
rv = mParent->Constrain(aInstantiations);
rv = mParent->Constrain(aInstantiations, aClosure);
}
else {
rv = NS_OK;

Просмотреть файл

@ -137,7 +137,7 @@ public:
virtual const char* Type() const = 0;
virtual PLHashNumber Hash() const = 0;
virtual PRBool Equals(const MemoryElement& aElement) const = 0;
virtual MemoryElement* Clone() const = 0;
virtual MemoryElement* Clone(void* aPool) const = 0;
PRBool operator==(const MemoryElement& aMemoryElement) const {
return Equals(aMemoryElement);
@ -719,7 +719,7 @@ class InnerNode : public ReteNode
{
public:
// "upward" propogations
virtual nsresult Constrain(InstantiationSet& aInstantiations) = 0;
virtual nsresult Constrain(InstantiationSet& aInstantiations, void* aClosure) = 0;
virtual nsresult GetAncestorVariables(VariableSet& aVariables) const = 0;
@ -744,7 +744,7 @@ public:
virtual nsresult Propogate(const InstantiationSet& aInstantiations, void* aClosure);
// "upward" propogations
virtual nsresult Constrain(InstantiationSet& aInstantiations);
virtual nsresult Constrain(InstantiationSet& aInstantiations, void* aClosure);
virtual nsresult GetAncestorVariables(VariableSet& aVariables) const;
@ -773,7 +773,7 @@ public:
virtual nsresult Propogate(const InstantiationSet& aInstantiations, void* aClosure);
// "upward" propogations
virtual nsresult Constrain(InstantiationSet& aInstantiations);
virtual nsresult Constrain(InstantiationSet& aInstantiations, void* aClosure);
virtual nsresult GetAncestorVariables(VariableSet& aVariables) const;
@ -808,10 +808,10 @@ public:
virtual nsresult Propogate(const InstantiationSet& aInstantiations, void* aClosure);
// "upward" propogations
virtual nsresult Constrain(InstantiationSet& aInstantiations);
virtual nsresult Constrain(InstantiationSet& aInstantiations, void* aClosure);
// instantiation filtering
virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations) const = 0; //XXX probably better named "ApplyConstraints" or "Discrminiate" or something
virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations, void* aClosure) const = 0; //XXX probably better named "ApplyConstraints" or "Discrminiate" or something
virtual nsresult GetAncestorVariables(VariableSet& aVariables) const;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -598,7 +598,7 @@ RootNode::Propogate(const InstantiationSet& aInstantiations, void* aClosure)
}
nsresult
RootNode::Constrain(InstantiationSet& aInstantiations)
RootNode::Constrain(InstantiationSet& aInstantiations, void* aClosure)
{
return NS_OK;
}
@ -676,7 +676,7 @@ JoinNode::Propogate(const InstantiationSet& aInstantiations, void* aClosure)
if (! instantiations.Empty()) {
// propogate consistency checking back up the tree
rv = test->Constrain(instantiations);
rv = test->Constrain(instantiations, aClosure);
if (NS_FAILED(rv)) return rv;
NodeSet::Iterator last = mKids.Last();
@ -753,7 +753,7 @@ JoinNode::Bind(InstantiationSet& aInstantiations, PRBool* aDidBind)
}
nsresult
JoinNode::Constrain(InstantiationSet& aInstantiations)
JoinNode::Constrain(InstantiationSet& aInstantiations, void* aClosure)
{
if (aInstantiations.Empty())
return NS_OK;
@ -782,7 +782,7 @@ JoinNode::Constrain(InstantiationSet& aInstantiations)
last = mLeftParent;
}
rv = first->Constrain(aInstantiations);
rv = first->Constrain(aInstantiations, aClosure);
if (NS_FAILED(rv)) return rv;
if (! didBind) {
@ -792,7 +792,7 @@ JoinNode::Constrain(InstantiationSet& aInstantiations)
NS_ASSERTION(didBind, "uh oh, still no binding");
}
rv = last->Constrain(aInstantiations);
rv = last->Constrain(aInstantiations, aClosure);
if (NS_FAILED(rv)) return rv;
if (! didBind) {
@ -865,7 +865,7 @@ TestNode::Propogate(const InstantiationSet& aInstantiations, void* aClosure)
nsresult rv;
InstantiationSet instantiations = aInstantiations;
rv = FilterInstantiations(instantiations);
rv = FilterInstantiations(instantiations, aClosure);
if (NS_FAILED(rv)) return rv;
if (! instantiations.Empty()) {
@ -879,17 +879,17 @@ TestNode::Propogate(const InstantiationSet& aInstantiations, void* aClosure)
nsresult
TestNode::Constrain(InstantiationSet& aInstantiations)
TestNode::Constrain(InstantiationSet& aInstantiations, void* aClosure)
{
nsresult rv;
rv = FilterInstantiations(aInstantiations);
rv = FilterInstantiations(aInstantiations, aClosure);
if (NS_FAILED(rv)) return rv;
if (! aInstantiations.Empty()) {
// if we still have instantiations, then ride 'em on up to the
// parent to narrow them.
rv = mParent->Constrain(aInstantiations);
rv = mParent->Constrain(aInstantiations, aClosure);
}
else {
rv = NS_OK;

Просмотреть файл

@ -137,7 +137,7 @@ public:
virtual const char* Type() const = 0;
virtual PLHashNumber Hash() const = 0;
virtual PRBool Equals(const MemoryElement& aElement) const = 0;
virtual MemoryElement* Clone() const = 0;
virtual MemoryElement* Clone(void* aPool) const = 0;
PRBool operator==(const MemoryElement& aMemoryElement) const {
return Equals(aMemoryElement);
@ -719,7 +719,7 @@ class InnerNode : public ReteNode
{
public:
// "upward" propogations
virtual nsresult Constrain(InstantiationSet& aInstantiations) = 0;
virtual nsresult Constrain(InstantiationSet& aInstantiations, void* aClosure) = 0;
virtual nsresult GetAncestorVariables(VariableSet& aVariables) const = 0;
@ -744,7 +744,7 @@ public:
virtual nsresult Propogate(const InstantiationSet& aInstantiations, void* aClosure);
// "upward" propogations
virtual nsresult Constrain(InstantiationSet& aInstantiations);
virtual nsresult Constrain(InstantiationSet& aInstantiations, void* aClosure);
virtual nsresult GetAncestorVariables(VariableSet& aVariables) const;
@ -773,7 +773,7 @@ public:
virtual nsresult Propogate(const InstantiationSet& aInstantiations, void* aClosure);
// "upward" propogations
virtual nsresult Constrain(InstantiationSet& aInstantiations);
virtual nsresult Constrain(InstantiationSet& aInstantiations, void* aClosure);
virtual nsresult GetAncestorVariables(VariableSet& aVariables) const;
@ -808,10 +808,10 @@ public:
virtual nsresult Propogate(const InstantiationSet& aInstantiations, void* aClosure);
// "upward" propogations
virtual nsresult Constrain(InstantiationSet& aInstantiations);
virtual nsresult Constrain(InstantiationSet& aInstantiations, void* aClosure);
// instantiation filtering
virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations) const = 0; //XXX probably better named "ApplyConstraints" or "Discrminiate" or something
virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations, void* aClosure) const = 0; //XXX probably better named "ApplyConstraints" or "Discrminiate" or something
virtual nsresult GetAncestorVariables(VariableSet& aVariables) const;

Разница между файлами не показана из-за своего большого размера Загрузить разницу