Skip to content

Commit

Permalink
Fix DeltaBlue and Richards.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmccutchan committed Apr 16, 2013
1 parent 898af0e commit 5258286
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkgs/benchmark_harness/example/DeltaBlue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class Variable {

/// Removes all traces of c from this variable.
void removeConstraint(Constraint c) {
constraints = constraints.where((e) => c != e).toList();
constraints.removeWhere((e) => c == e);
if (determinedBy == c) determinedBy = null;
}
}
Expand Down
13 changes: 9 additions & 4 deletions pkgs/benchmark_harness/example/Richards.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import 'package:benchmark_harness/benchmark_harness.dart';


main() {
new Richards().report();
}
Expand Down Expand Up @@ -77,8 +78,12 @@ class Richards extends BenchmarkBase {
print("Error during execution: queueCount = ${scheduler.queueCount}"
", holdCount = ${scheduler.holdCount}.");
}
Expect.equals(EXPECTED_QUEUE_COUNT, scheduler.queueCount);
Expect.equals(EXPECTED_HOLD_COUNT, scheduler.holdCount);
if (EXPECTED_QUEUE_COUNT != scheduler.queueCount) {
throw "bad scheduler queue-count";
}
if (EXPECTED_HOLD_COUNT != scheduler.holdCount) {
throw "bad scheduler hold-count";
}
}

static const int DATA_SIZE = 4;
Expand Down Expand Up @@ -120,7 +125,7 @@ class Scheduler {
int currentId;
TaskControlBlock list;
List<TaskControlBlock> blocks =
new List<TaskControlBlock>.fixedLength(Richards.NUMBER_OF_IDS);
new List<TaskControlBlock>(Richards.NUMBER_OF_IDS);

/// Add an idle task to this scheduler.
void addIdleTask(int id, int priority, Packet queue, int count) {
Expand Down Expand Up @@ -461,7 +466,7 @@ class Packet {
int kind; // The type of this packet.
int a1 = 0;

List<int> a2 = new List.fixedLength(Richards.DATA_SIZE);
List<int> a2 = new List(Richards.DATA_SIZE);

Packet(this.link, this.id, this.kind);

Expand Down

0 comments on commit 5258286

Please sign in to comment.