mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
feat(c-api) Rename Operator to wasmer_parser_operator_t.
This commit is contained in:
@@ -125,7 +125,7 @@
|
||||
//! ```
|
||||
|
||||
use super::super::super::instance::wasm_instance_t;
|
||||
use super::super::parser::operator::Operator as COperator;
|
||||
use super::super::parser::operator::wasmer_parser_operator_t;
|
||||
use super::wasmer_middleware_t;
|
||||
use std::sync::Arc;
|
||||
use wasmer::wasmparser::Operator;
|
||||
@@ -202,7 +202,7 @@ pub struct wasmer_metering_t {
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type wasmer_metering_cost_function_t = extern "C" fn(operator: COperator) -> u64;
|
||||
pub type wasmer_metering_cost_function_t = extern "C" fn(operator: wasmer_parser_operator_t) -> u64;
|
||||
|
||||
/// Creates a new metering middleware with an initial limit, i.e. a
|
||||
/// total number of operators to execute (regarding their respective
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use wasmer::wasmparser::Operator as OriginalOperator;
|
||||
use wasmer::wasmparser::Operator;
|
||||
|
||||
#[repr(C)]
|
||||
pub enum Operator {
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum wasmer_parser_operator_t {
|
||||
Unreachable,
|
||||
Nop,
|
||||
Block,
|
||||
@@ -505,9 +506,9 @@ pub enum Operator {
|
||||
I32x4TruncSatF64x2UZero,
|
||||
}
|
||||
|
||||
impl<'a> From<&OriginalOperator<'a>> for Operator {
|
||||
fn from(operator: &OriginalOperator<'a>) -> Self {
|
||||
use OriginalOperator::*;
|
||||
impl<'a> From<&Operator<'a>> for wasmer_parser_operator_t {
|
||||
fn from(operator: &Operator<'a>) -> Self {
|
||||
use Operator::*;
|
||||
|
||||
match operator {
|
||||
Unreachable => Self::Unreachable,
|
||||
|
||||
Reference in New Issue
Block a user