Skip to content
Discussion options

You must be logged in to vote

Actually (now that I have a clearer mind and I'm not rage-debugging) I think I found something:

Here is the struct definition in C:

typedef struct wasm_val_t {
  wasm_valkind_t kind;
  union {
    int32_t i32;
    int64_t i64;
    float32_t f32;
    float64_t f64;
    struct wasm_ref_t* ref;
  } of;
} wasm_val_t;

And here in Rust:

pub struct wasm_val_t {
    /// The kind of the Wasm value.
    pub kind: wasm_valkind_t,
    /// The underlying data of the Wasm value classified by `kind`.
    pub of: wasm_val_union,
}

Importantly, wasm_val_union includes a u128 field, making it 16 bytes instead of the 8 in the C version:

pub union wasm_val_union {
    /// A Wasm 32-bit signed integer.
    pub 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dimitris-aspetakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant