Class: Relaton::Un::Wasm::MemoryAdapter

Inherits:
Struct
  • Object
show all
Defined in:
lib/relaton/un/wasm/interpreter.rb

Overview

Thin shim presenting the wasmtime Memory API the existing import bodies expect: #read(addr, len) returning bytes, #write(addr, bytes).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#memoryObject

Returns the value of attribute memory

Returns:

  • (Object)

    the current value of memory



46
47
48
# File 'lib/relaton/un/wasm/interpreter.rb', line 46

def memory
  @memory
end

Instance Method Details

#read(addr, len) ⇒ Object



47
# File 'lib/relaton/un/wasm/interpreter.rb', line 47

def read(addr, len); memory.read(addr, len); end

#write(addr, bytes) ⇒ Object



48
# File 'lib/relaton/un/wasm/interpreter.rb', line 48

def write(addr, bytes); memory.write(addr, bytes); end