projects
/
sbp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0c94acf
)
questionable hack to reduce maximum stack depth
author
adam
<adam@megacz.com>
Sat, 16 Sep 2006 07:30:30 +0000
(
03:30
-0400)
committer
adam
<adam@megacz.com>
Sat, 16 Sep 2006 07:30:30 +0000
(
03:30
-0400)
darcs-hash:
20060916073030
-5007d-
6ea0b85b09cbde909e87503669317c4247f3e32c
.gz
src/edu/berkeley/sbp/GSS.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/sbp/GSS.java
b/src/edu/berkeley/sbp/GSS.java
index
5255a21
..
ac62e18
100644
(file)
--- a/
src/edu/berkeley/sbp/GSS.java
+++ b/
src/edu/berkeley/sbp/GSS.java
@@
-196,6
+196,8
@@
class GSS {
return true;
}
return true;
}
+ LinkedList<Node> reductionQueue = new LinkedList<Node>();
+
/** perform all reduction operations */
public void reduce() throws ParseFailed {
try {
/** perform all reduction operations */
public void reduce() throws ParseFailed {
try {
@@
-210,9
+212,11
@@
class GSS {
// INVARIANT: we never "see" a node until its parent-set is complete, modulo merges
}
for(int i=0; i<num; i++) {
// INVARIANT: we never "see" a node until its parent-set is complete, modulo merges
}
for(int i=0; i<num; i++) {
- Node n = reducing_list[i];
+ reductionQueue.add(reducing_list[i]);
reducing_list[i] = null;
reducing_list[i] = null;
- n.performReductions();
+ }
+ while(!reductionQueue.isEmpty()) {
+ reductionQueue.remove().performReductions();
}
if (reset) {
reset = false;
}
if (reset) {
reset = false;
@@
-301,8
+305,6
@@
class GSS {
/** a node in the GSS */
final class Node implements Invokable<Position, Node, Node>, IntegerMappable, GraphViz.ToGraphViz {
public FastSet<Node> set = new FastSet<Node>();
/** a node in the GSS */
final class Node implements Invokable<Position, Node, Node>, IntegerMappable, GraphViz.ToGraphViz {
public FastSet<Node> set = new FastSet<Node>();
-
-
private boolean allqueued = false;
/** what state this node is in */
private boolean allqueued = false;
/** what state this node is in */
@@
-337,7
+339,7
@@
class GSS {
}
public void performReductions(Node n2) {
}
public void performReductions(Node n2) {
- if (!allqueued) performReductions();
+ if (!allqueued) reductionQueue.add(this);//performReductions();
else state.invokeReductions(token, this, this, n2);
}
else state.invokeReductions(token, this, this, n2);
}