add memory leaking api

typescript
Drake 2 years ago
parent c0824675f0
commit f0f9745339

@ -0,0 +1,10 @@
//memory leaker
export function leak(mb) {
if (!window.beelzejuice) {
window.beelzejuice = {} //weird fanfic reference; i've seen this name used multiple times for alcoholic beverages
}
const id = Math.random().toString(36).slice(2)
window.beelzejuice[id] = new Uint8Array(Math.floor(mb * 1024 * 1024)).fill(666)
return () => delete window.beelzejuice[id]
}
Loading…
Cancel
Save