Skip to content

Commit

Permalink
FIXES bytecodealliance#137: make calling wasm from python 7x faster
Browse files Browse the repository at this point in the history
  • Loading branch information
muayyad-alsadi committed Mar 27, 2023
1 parent 7bee159 commit d0913e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wasmtime/_func.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from contextlib import contextmanager
from ctypes import POINTER, byref, CFUNCTYPE, c_void_p, cast
import ctypes
from wasmtime import Store, FuncType, Val, IntoVal, Trap, WasmtimeError
from wasmtime import Store, FuncType, Val, IntoVal, Trap, WasmtimeError, ValType
from . import _ffi as ffi
from ._extern import wrap_extern
from typing import Callable, Optional, Generic, TypeVar, List, Union, Tuple, cast as cast_type, Sequence
Expand Down Expand Up @@ -33,7 +33,7 @@
WASMTIME_EXTERNREF.value: 'externref',
}

def get_valtype_attr(ty):
def get_valtype_attr(ty: ValType):
return val_id2attr[wasm_valtype_kind(ty._ptr)]

class Func:
Expand Down Expand Up @@ -99,7 +99,7 @@ def _extract_return(self, vals_raw: ctypes.Array[wasmtime_val_raw_t]) -> Union[I
# we can use tuple construct, but I'm using list for compatability
return [getattr(val_raw, ret_str) for val_raw, ret_str in zip(vals_raw, self._results_str)]

def _init_call(self, ty):
def _init_call(self, ty: FuncType):
"""init signature properties used by call"""
self._ty = ty
ty_params = ty.params
Expand Down

0 comments on commit d0913e8

Please sign in to comment.