Raymond Hill
5 years ago
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with
6 additions and
5 deletions
-
src/js/hntrie.js
-
src/js/start.js
|
|
@ -519,12 +519,11 @@ const HNTrieContainer = class { |
|
|
|
} |
|
|
|
|
|
|
|
async initWASM() { |
|
|
|
const module = await HNTrieContainer.enableWASM(); |
|
|
|
if ( module instanceof WebAssembly.Module === false ) { return false; } |
|
|
|
|
|
|
|
if ( this.wasmInstancePromise !== null ) { |
|
|
|
return true; |
|
|
|
return this.wasmInstancePromise; |
|
|
|
} |
|
|
|
const module = await HNTrieContainer.enableWASM(); |
|
|
|
if ( module instanceof WebAssembly.Module === false ) { return false; } |
|
|
|
const memory = new WebAssembly.Memory({ initial: 2 }); |
|
|
|
this.wasmInstancePromise = WebAssembly.instantiate( |
|
|
|
module, |
|
|
|
|
|
@ -32,7 +32,9 @@ |
|
|
|
]); |
|
|
|
log.info(`User settings ready ${Date.now()-vAPI.T0} ms after launch`); |
|
|
|
|
|
|
|
const shouldWASM = µm.rawSettings.disableWebAssembly !== true; |
|
|
|
const shouldWASM = |
|
|
|
vAPI.canWASM === true && |
|
|
|
µm.rawSettings.disableWebAssembly !== true; |
|
|
|
if ( shouldWASM ) { |
|
|
|
await Promise.all([ |
|
|
|
µm.HNTrieContainer.enableWASM(), |
|
|
|