singleton pause object to reduce allocation
This commit is contained in:
parent
b788e1bb57
commit
0ad456d380
|
@ -488,11 +488,12 @@
|
||||||
|
|
||||||
var Pause = function(onPause) {
|
var Pause = function(onPause) {
|
||||||
// onPause: MACHINE -> void
|
// onPause: MACHINE -> void
|
||||||
this.onPause = onPause || function(MACHINE) {};
|
this.onPause = onPause;
|
||||||
};
|
};
|
||||||
|
var THE_SINGLETON_PAUSE = new Pause();
|
||||||
var PAUSE = function(onPause) {
|
var PAUSE = function(onPause) {
|
||||||
throw(new Pause(onPause));
|
THE_SINGLETON_PAUSE.onPause = onPause;
|
||||||
|
throw(THE_SINGLETON_PAUSE);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -564,7 +565,7 @@
|
||||||
scheduleTrampoline(that, thunk, release);
|
scheduleTrampoline(that, thunk, release);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (e instanceof Pause) {
|
} else if (e === THE_SINGLETON_PAUSE) {
|
||||||
var pauseLock = new ExclusiveLock();
|
var pauseLock = new ExclusiveLock();
|
||||||
var oldArgcount = that.a;
|
var oldArgcount = that.a;
|
||||||
var restarted = false;
|
var restarted = false;
|
||||||
|
|
|
@ -7,4 +7,4 @@
|
||||||
(provide version)
|
(provide version)
|
||||||
(: version String)
|
(: version String)
|
||||||
|
|
||||||
(define version "1.213")
|
(define version "1.215")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user