Add wasm module global type information APIs (#3406)
Support getting global type from `wasm_runtime_get_import_type` and `wasm_runtime_get_export_type`, and add two APIs: ```C wasm_valkind_t wasm_global_type_get_valkind(const wasm_global_type_t global_type); bool wasm_global_type_get_mutable(const wasm_global_type_t global_type); ```
This commit is contained in:
@ -584,11 +584,15 @@ typedef struct WASMTagImport {
|
||||
} WASMTagImport;
|
||||
#endif
|
||||
|
||||
typedef struct WASMGlobalType {
|
||||
uint8 val_type;
|
||||
bool is_mutable;
|
||||
} WASMGlobalType;
|
||||
|
||||
typedef struct WASMGlobalImport {
|
||||
char *module_name;
|
||||
char *field_name;
|
||||
uint8 type;
|
||||
bool is_mutable;
|
||||
WASMGlobalType type;
|
||||
bool is_linked;
|
||||
/* global data after linked */
|
||||
WASMValue global_data_linked;
|
||||
@ -705,8 +709,7 @@ struct WASMTag {
|
||||
#endif
|
||||
|
||||
struct WASMGlobal {
|
||||
uint8 type;
|
||||
bool is_mutable;
|
||||
WASMGlobalType type;
|
||||
#if WASM_ENABLE_GC != 0
|
||||
WASMRefType *ref_type;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user