MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / load

Method load

python/basisu_py/wasm/wasm_encoder.py:30–45  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 self.store.set_wasi(wasi)
29
30 def load(self):
31 self._init_engine()
32
33 module = wasmtime.Module.from_file(self.engine, self.wasm_path)
34 linker = wasmtime.Linker(self.engine)
35 linker.define_wasi()
36
37 instance = linker.instantiate(self.store, module)
38 self.exports = instance.exports(self.store)
39 self.memory = self.exports["memory"]
40
41 # Initialize if present
42 if "bu_init" in self.exports:
43 self.exports["bu_init"](self.store)
44
45 print("[WASM Encoder] Loaded:", self.wasm_path)
46
47 # ------------------------------------------------------
48 # Access raw linear memory buffer

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 1

_init_engineMethod · 0.95

Tested by

no test coverage detected