Skip to content

Commit

Permalink
chore(loader): disable metering
Browse files Browse the repository at this point in the history
  • Loading branch information
twilson63 committed Oct 3, 2024
1 parent e9c9673 commit 0b52cf1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions loader/src/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ module.exports = async function (binary, options) {
} else {

if (typeof binary === "function") {
WebAssembly.instantiate = async function (wasm, info) {
const meteredWasm = metering.meterWASM(wasm, { meterType });
return originalInstantiate(meteredWasm, info);
};
// TODO: wasmMetering is currently disabled on
// WebAssembly.instantiate = async function (wasm, info) {
// const meteredWasm = metering.meterWASM(wasm, { meterType });
// return originalInstantiate(wasm, info);
// };
options.instantiateWasm = binary
} else {
binary = metering.meterWASM(binary, { meterType })
//binary = metering.meterWASM(binary, { meterType })
options.wasmBinary = binary
}

Expand Down Expand Up @@ -156,6 +157,7 @@ module.exports = async function (binary, options) {
}

return async (buffer, msg, env) => {

const originalRandom = Math.random
// const OriginalDate = Date
const originalLog = console.log
Expand Down

0 comments on commit 0b52cf1

Please sign in to comment.