summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/measure-memory/resources/worker.js
blob: 000df1272948ef22b5963978a015b56e70fc8093 (plain)
1
2
3
4
5
6
7
8
9
self.onmessage = function(message) {
  const length = message.data.bytes;
  self.root = new Uint8Array(length);
  // Set some elements to disable potential copy-on-write optimizations.
  for (let i = 0; i < length; i += 256) {
    self.root[i] = 1;
  }
  postMessage(self.location.href);
}