aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-05-30 10:01:14 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-05-30 10:02:43 -0700
commit156fe33bfee89b764df0781a84acd635c44bc4da (patch)
tree45f4cdbff6f0076633bf8a42d8e5be21c1a94c5d
parentcc90517289784817d08cfd0035cdbe92957c75d3 (diff)
heap hash debugging function
-rw-r--r--src/determinstic.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/determinstic.js b/src/determinstic.js
index 91f98ed9..1ec0bbfe 100644
--- a/src/determinstic.js
+++ b/src/determinstic.js
@@ -10,3 +10,11 @@ Date.now = function() {
};
performance.now = Date.now;
+function hashMemory(id) {
+ var ret = 0;
+ for (var i = 0; i < HEAPU8.length; i++) {
+ ret = (ret*17 + HEAPU8[i])|0;
+ }
+ print(id + ':' + ret);
+}
+